Skip to content

Instantly share code, notes, and snippets.

@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@baoshan
baoshan / install-pypy.sh
Created April 24, 2012 11:23
Install PyPy on CentOS
# yum list \*openssl\*
yum install -y openssl098e
yum install -y zlib
ln -s /usr/lib64/libssl.so.0.9.8e /usr/lib64/libssl.so.0.9.8
ln -s /usr/lib64/libcrypto.so.0.9.8e /usr/lib64/libcrypto.so.0.9.8
ln -s /lib64/libbz2.so.1 /lib64/libbz2.so.1.0
wget https://bitbucket.org/pypy/pypy/downloads/pypy-1.8-linux64.tar.bz2
tar -xf pypy-1.8-linux64.tar.bz2
cp -r pypy-1.8 /opt
ln -s /opt/pypy-1.8/bin/pypy /usr/local/bin
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active July 22, 2024 12:48
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 20, 2024 05:10
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@hajovsky
hajovsky / gist:9778146
Created March 26, 2014 07:12
how to thunkify the mongodb native
// npm install mongodb thunkify-wrap co
var mongo = require('mongodb');
var t = require('thunkify-wrap');
var co = require('co');
co(function*(){
var db = yield t(mongo.MongoClient.connect)('mongodb://127.0.0.1:27017/test');
var items = db.collection('items');
// cleanup
@andretw
andretw / network_related.sh
Last active January 14, 2016 16:50
Network related for MacOS X
@andretw
andretw / git.md
Last active September 17, 2015 04:00
Useful Git tips.

(Seems like) To move n commits (not pushed to remote branch yet) from master branch to a new branch (mynewbranch)

git branch mynewbranch        # copy current commits to the new branch
git reset --hard HEAD~1       # reset 1 commit, replace 1 to n or any other natural number you want. 

To change last commit message.

git commit --amend -m 'new message'

The Reactive Manifesto 反應式宣言

Published on September 16 2014. (v2.0) 發佈於 2014 年 9 月 16 日 (v2.0)

Organisations working in disparate domains are independently discovering patterns for building software that look the same. These systems are more robust, more resilient, more flexible and better positioned to meet modern demands.

These changes are happening because application requirements have changed dramatically in recent years. Only a few years ago a large application had tens of servers, seconds of response time, hours of offline maintenance and gigabytes of data. Today applications are deployed on everything from mobile devices to cloud-based clusters running thousands of multi-core processors. Users expect millisecond response times and 100% uptime. Data is measured in Petabytes. Today's demands are simply not met by yesterday’s software architectures.

We believe that a coherent approach to systems architecture is needed, and we believe that all necessary aspects are already recognised individually

@andretw
andretw / notes_of_docker.md
Last active August 29, 2015 14:11
Docker

Remember to get the latest boot2docker and docker!

install

brew install boot2docker
brew install docker

create container

docker pull centos
@mubbashir
mubbashir / Jenkins+Script+Console.md
Last active October 9, 2023 07:10 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.