Skip to content

Instantly share code, notes, and snippets.

@ollieatkinson
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
tleish / mysql_backup.sh
Last active Nov 29, 2022
Bash Script to backup all MySQL databases
View mysql_backup.sh
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@IamGroooooot
IamGroooooot / NaverMapSelenium.py
Last active Nov 29, 2022
네이버 신지도 크롤링 with Selenium and BeautifulSoup
View NaverMapSelenium.py
# 코알라유니브 스터디: 공공공공공경경 - 고주형
# 네이버 신지도 데이터 수집하기
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from bs4 import BeautifulSoup
driver = webdriver.Chrome("./chromedriver")
driver.get("https://map.naver.com/v5/search")
@riverscn
riverscn / 北京联通IPTV内网组播.m3u
Created Aug 4, 2019
北京联通IPTV内网组播地址节目表(239.2.1.1网段)
View 北京联通IPTV内网组播.m3u
#EXTM3U name="北京联通IPTV(RTP)”
#EXTINF:-1,CCTV-1高清(1)
rtp://239.2.1.129:8000
#EXTINF:-1,CCTV-2高清(2)
rtp://239.2.1.60:8084
#EXTINF:-1,CCTV-4高清(4)
rtp://239.2.1.105:8092
#EXTINF:-1,CCTV-7高清(7)
rtp://239.2.1.61:8104
#EXTINF:-1,CCTV-9高清(9)
@72lions
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
jacobblock / FreeNAS.md
Last active Nov 29, 2022
Ultimate FreeNAS Setup
View FreeNAS.md

FreeNAS

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.

ToC

@atyachin
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 https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
5. unzip commandlinetools-linux-8512546_latest.zip -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)
View regex.md

REGEX Cheatsheet

This is a Regex cheatsheet

Summary

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
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
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
UNICODETAB = [ch for ch in UNICODETAB]