Skip to content

Instantly share code, notes, and snippets.

@GabrielFreeze
GabrielFreeze / christmas.c
Last active May 7, 2024 12:05
Prints Christmas Tree (with colour)
#include <stdio.h>
#include <stdint.h>
int main() {
uint64_t idx[766]={0x061861861861861c,0x0658618618618618,0x0199615280482483,0x025940a1d2045485,0x005205954a112192,0x001205209954a012,0x061861861861854a,
0x0618618618618618,0x06186187162806d8,0x0618618618618618,0x0242480119618618,0x005224205940a012,0x02030993ca0920c0,0x00592ca212180092,0x034a1d2086052009,
0x044a0520464891d9,0x061854a012192259,0x0618618618618618,0x02806d8618618618,0x0618618618618716,0x0658618618618618,0x0481655280481481,0x0480001655280481,
0x018905944a012147,0x005938a0d2045052,0x04ca0920820520c6,0x054a012002489099,0x0615280481481658,0x0618618618618618,0x02806d8618618618,0x07de561b2cae2556,
0x065882398a7639ec,0x0658615280482480,0x0288484181480002,0x02804830d20c564d,0x054a012112099610,0x0618618618618618,0x06d8618618618618,0x0b249a954f556280,
0x0ae5aebb28b6aae7,0x054a012152019618,0x0651280489252099,0x04ca092107052204,0x0102486081487099,0x02014840521d93ca,0x001205209961854a,0x054a01205205954a,
@agbishara
agbishara / Generate CSV from mysql and email out.php
Last active May 7, 2024 12:05
Generate CSV from mysql and email out
<?php
//src: http://stackoverflow.com/questions/10334753/how-to-send-an-email-with-a-csv-attachment-from-a-string
//mysql user variables
$mysqli = new mysqli("localhost", "user", "password", "database");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
@galiazzi
galiazzi / Cast.php
Last active May 7, 2024 12:04
Doctrine DQL cast function
<?php
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
class Cast extends FunctionNode
{
private $expr1;
@JGrossholtz
JGrossholtz / modbus_rs232_master_client.c
Last active May 7, 2024 12:00
A sample libmodbus client / server (master/slave) using RS232 to request data from a modbus client (tested with libmodbus3.0.6)
#include <stdio.h>
#include <unistd.h>
#include <modbus.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/serial.h>
#include <asm/ioctls.h>
#define NB_REGS 2
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@m-jovanovic
m-jovanovic / .editorconfig
Created June 7, 2023 12:17
Sample editor config with a bunch of rules turned off 😅
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
@jacknlliu
jacknlliu / env-Dockerfile
Last active May 7, 2024 11:57
use variable "DEBIAN_FRONTEND noninteractive" to apt-get noninteractive install and set environment and use shell script in Dockerfile
ENV QT_BASE_DIR=/opt/qt55
ENV QTDIR=$QT_BASE_DIR
ENV PATH=$QT_BASE_DIR/bin:$PATH
ENV LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH
ENV PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
# Reconfigure locale
RUN locale-gen en_US.UTF-8 && dpkg-reconfigure locales
# Docker offical ENVIRONMETN REPLACEMENT
@J05HI
J05HI / eBay_Kleinanzeigen_Anzeige_duplizieren.js
Last active May 7, 2024 11:56
Add "reinstate" functionality, refactoring
// ==UserScript==
// @name eBay Kleinanzeigen - Anzeige duplizieren / neu einstellen
// @namespace https://github.com/J05HI
// @description Bietet eine "Anzeige duplizieren / neu einstellen" Funktion beim Bearbeiten einer vorhandenen Anzeige in eBay Kleinanzeigen.
// @icon http://www.google.com/s2/favicons?domain=www.kleinanzeigen.de
// @copyright 2024, J05HI (https://github.com/J05HI)
// @license MIT
// @version 1.4.0
// @match https://www.kleinanzeigen.de/p-anzeige-bearbeiten.html*
// @grant none
@danielchc
danielchc / docker-emby-bypass.md
Last active May 7, 2024 11:56
Emby Premiere: ByPass Docker container

Emby Premiere ByPass Docker container

❗ All the information provided on this tutorial are for educational purposes only. I'm not responsible for any misuse of this information. If you like the app buy it

Table of Contents

#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)