Skip to content

Instantly share code, notes, and snippets.

View Sn0wCrack's full-sized avatar
🍙
​はらへた

Sn0wCrack

🍙
​はらへた
View GitHub Profile
@DavidEredics
DavidEredics / resolved.conf
Last active November 27, 2023 09:23
Cloudflare DNS over TLS systemd resolved config
[Resolve]
DNS=1.1.1.1#1dot1dot1dot1.cloudflare-dns.com 1.0.0.1#1dot1dot1dot1.cloudflare-dns.com 2606:4700:4700::1111#1dot1dot1dot1.cloudflare-dns.com 2606:4700:4700::1001#1dot1dot1dot1.cloudflare-dns.com
DNSSEC=yes
DNSOverTLS=yes
@timkuijsten
timkuijsten / mysql_backup
Last active July 7, 2020 06:46
mysql per database backup without mysql.event warning
#!/bin/sh -
# The important part is not to put the password as an argument to the mysql
# commands, i.e. don't use the -p option. Instead use a .my.cnf file in the home
# dir of the user you are running this script as, i.e. /root/.my.cnf if running
# as root. Make the file readable for the owner only: chmod 400 /root/.my.cnf
# See: http://stackoverflow.com/questions/17829659/securing-backup-credentials-for-mysqldump/17844997#17844997
umask 007
@Sn0wCrack
Sn0wCrack / cp1252toUTF8.php
Created July 1, 2013 01:41
CP1252 (Windows-1252) Unicode PHP Array. Asigns CP1252 (Windows-1252) escape sequences to UTF-8 escape sequences.
<?php
$cp1252_map = array(
"\x80" => "\xE2\x82\xAC", // EURO SIGN
"\x82" => "\xE2\x80\x9A", // SINGLE LOW-9 QUOTATION MARK
"\x83" => "\xC6\x92", // LATIN SMALL LETTER F WITH HOOK
"\x84" => "\xE2\x80\x9E", // DOUBLE LOW-9 QUOTATION MARK
"\x85" => "\xE2\x80\xA6", // HORIZONTAL ELLIPSIS
"\x86" => "\xE2\x80\xA0", // DAGGER
"\x87" => "\xE2\x80\xA1", // DOUBLE DAGGER
"\x88" => "\xCB\x86", // MODIFIER LETTER CIRCUMFLEX ACCENT
@Sn0wCrack
Sn0wCrack / INIFile.cs
Last active August 16, 2023 20:23
A simple way to read INI Files with C#
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace <INSERT_NAMESPACE_HERE>
{
public class INIFile
{
public string path { get; private set; }
@darktable
darktable / DebugConsole.cs
Created December 1, 2011 00:25
Unity3D: Heavily modified version of Jeremy Hollingsworth's DebugConsole script.
#define DEBUG_CONSOLE
#define DEBUG_LEVEL_LOG
#define DEBUG_LEVEL_WARN
#define DEBUG_LEVEL_ERROR
#if (UNITY_EDITOR || DEVELOPMENT_BUILD)
#define DEBUG
#endif
#if (UNITY_IOS || UNITY_ANDROID)