Skip to content

Instantly share code, notes, and snippets.

ollieatkinson / AnyDiffable.swift
Last active Nov 29, 2022
Implementation of Paul Heckel's Diff Algorithm in Swift 3
View AnyDiffable.swift
public protocol Diffable: Hashable {
var primaryKeyValue: String { get }
/// A type-erased diffable value.
/// The AnyDiffable type forwards diffing, equality comparisons and hashing operations to an underlying diffing value,
/// hiding its specific underlying type.
tleish /
Last active Nov 29, 2022
Bash Script to backup all MySQL databases
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#USAGE: ./
# example cron for daily db backup @ 9:15 am
IamGroooooot /
Last active Nov 29, 2022
네이버 신지도 크롤링 with Selenium and BeautifulSoup
# 코알라유니브 스터디: 공공공공공경경 - 고주형
# 네이버 신지도 데이터 수집하기
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from bs4 import BeautifulSoup
driver = webdriver.Chrome("./chromedriver")
riverscn / 北京联通IPTV内网组播.m3u
Created Aug 4, 2019
View 北京联通IPTV内网组播.m3u
#EXTM3U name="北京联通IPTV(RTP)”
72lions / concat.array.buffers.js
Created Jan 14, 2013
Concatenates two ArrayBuffers
View concat.array.buffers.js
* Creates a new Uint8Array based on two different ArrayBuffers
* @private
* @param {ArrayBuffers} buffer1 The first buffer.
* @param {ArrayBuffers} buffer2 The second buffer.
* @return {ArrayBuffers} The new ArrayBuffer created out of the two.
var _appendBuffer = function(buffer1, buffer2) {
var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
jacobblock /
Last active Nov 29, 2022
Ultimate FreeNAS Setup


I started using FreeNAS in August 2013. It is fantastic piece of software and I have been really impressed by the upgrades just in the few months I've been using it. It looks like they recently went to a plugin system as of version 9 to make installing software easier for end users. I've ran into several issues related to plugins and user + group permissions so I decided to just use the available FreeBSD port system. After fiddling for a few days (now turned into months) I believe I have created something helpful for the community and anyone interested in picking up the port system. The sandbox nature of FreeNAS's jail system is especially helpful for playing around without having any consequence on your core system.

Here are straight-forward instructions to setting up a bunch of different software on FreeNAS. If you make a terrible error, just throw up another plugin sandbox and repeat.


atyachin / Android_Emulator_AWS_EC2_ARM64_2022.txt
Last active Nov 29, 2022
Running headless android emulator on AWS EC2 Ubuntu instance (ARM64 / aarch64) - 2022
View Android_Emulator_AWS_EC2_ARM64_2022.txt
Android Emulator (ARM64) on EC2 - 2022
1. Launch EC2 ARM based Instance (a1.metal / a1.2xlarge): (16 Gb RAM, 32Gb Disk), Ubuntu Server 22.04 LTS (HVM) ARM x64
2. sudo apt update && sudo apt upgrade
3. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb
4. wget
5. unzip -d android-sdk
6. sudo mv android-sdk /opt/
7. mkdir /opt/android-sdk/cmdline-tools/latest
8. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest (ignore the error)

REGEX Cheatsheet

This is a Regex cheatsheet


A regular expression is a sequence of characters that defines a search pattern for a character combination. Such sequence is composed by preset notations (meta and literal characters) that form conditions to narrow a larger text down to the text of search.

This cheatsheet provides an overview of regex meta characters in the context of Javascript.

rocarvaj / .vimrc
Created Apr 27, 2012
Minimal .vimrc for C/C++ developers
View .vimrc
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
congkhoa / python3 tcvn3 to unicode
Last active Nov 29, 2022
TCVN3 to Unicode (python 3)
View python3 tcvn3 to unicode
# -*- coding: utf-8 -*-
import re
TCVN3TAB = "µ¸¶·¹¨»¾¼½Æ©ÇÊÈÉË®ÌÐÎÏѪÒÕÓÔÖ×ÝØÜÞßãáâä«åèæçé¬êíëìîïóñòô-õøö÷ùúýûüþ¡¢§£¤¥¦" # NOQA
TCVN3TAB = [ch for ch in TCVN3TAB]
UNICODETAB = "àáảãạăằắẳẵặâầấẩẫậđèéẻẽẹêềếểễệìíỉĩịòóỏõọôồốổỗộơờớởỡợùúủũụưừứửữựỳýỷỹỵĂÂĐÊÔƠƯ" # NOQA