Skip to content

Instantly share code, notes, and snippets.

View liuyanghejerry's full-sized avatar
Focusing

liuyanghejerry liuyanghejerry

Focusing
View GitHub Profile
@roxlu
roxlu / Parsing_Stun.txt
Created July 31, 2014 17:49
Some test data that can be used when parsing stun messages (WebRTC/ICE/STUN)
Below is a dump of a STUN message that can be used to validate your
STUN message integrity check. The password that is used to encrypt
the Message-Integrity is: "Q9wQj99nsQzldVI5ZuGXbEWRK5RhRXdC" (without quotes)
/* Raw STUN message as received from Chrome */
-----------
00 01 00 58
21 12 A4 42
48 75 38 77
| iOS Device | Release | iOS version |
| ------------ | ------------- | ------------ |
| iPhone(1st) | June 29, 2007 | 1.0 - 3.1.3(February 2, 2010) |
| iPhone 3G | July 11, 2008 | 2.0 - 4.2.1(November 22, 2010) |
| iPhone 3GS | June 19, 2009 | 3.0 - 6.1.6(February 21, 2014) |
| iPhone 4 | June 24, 2010 | 4.0 - 7.1.2(June 30, 2014) |
| iPhone 4S | October 14, 2011 | 5.0 - 8.3 |
| iPhone 5 | September 21, 2012 | 6.0 - 8.3 |
| iPhone 5C | September 20, 2013 | 7.0 - 8.3 |
| iPhone 5S | September 20, 2013 | 7.0 - 8.3 |
@bkono
bkono / ubuntu_redis_install.sh
Created May 7, 2012 05:54
Ubuntu Redis Install
#!/bin/bash
mkdir /opt/redis
#RedisVersion=2.2.14
RedisVersion=2.4.8
wget http://redis.googlecode.com/files/redis-$RedisVersion.tar.gz
tar -zxvf redis-$RedisVersion.tar.gz
cd redis-$RedisVersion
@liuyanghejerry
liuyanghejerry / redis.sh
Last active December 16, 2015 09:19
Redis-server management script for CentOS 6.3.
#!/bin/bash
# chkconfig: - 80 12
# description: Controller for redis-server
# processname: redis
# useage: redis {start|stop|restart}
# notice, you need to edit these 4 variables bellow to suit your condition
BIN="/usr/local/redis/bin/redis-server"
@milmazz
milmazz / ex_doc.md
Last active April 17, 2016 01:08
Elixir + ExDoc
@dorentus
dorentus / shadowsocks-server.service
Last active April 21, 2017 15:59
wget 'https://gist.githubusercontent.com/dorentus/10704239/raw/shadowsocks-server.service' -O /etc/systemd/system/shadowsocks-server.service && systemctl enable shadowsocks-server.service && systemctl start shadowsocks-server.service
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
Type=forking
PIDFile=/run/shadowsocks/server.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/shadowsocks
ExecStartPre=/bin/chown nobody:nogroup /run/shadowsocks
@eendeego
eendeego / README.md
Created November 14, 2012 17:44
Profiling node.js apps with Ben Noordhuis heapdump

This instructions allow you to take periodical heapdumps.

To use in your project, first install heapdump, then add the following code to your app just after requiring 'fs'.

@ManasJayanth
ManasJayanth / canvas-immediate.js
Created April 19, 2017 05:50
Canvas Immediate mode rendering using React
import type { HostConfig, Reconciler } from 'react-fiber-types';
import type { ReactNodeList } from 'react-fiber-types/ReactTypes';
import DOMPropertyOperations from './DOMPropertyOperations';
import type {
Props,
Container,
Instance,
TextInstance,
OpaqueHandle,
@smpallen99
smpallen99 / constants.ex
Created April 5, 2014 18:22
Approach for constants shared between modules in Elixir
defmodule Constants do
@moduledoc """
An alternative to use @constant_name value approach to defined reusable
constants in elixir.
This module offers an approach to define these in a
module that can be shared with other modules. They are implemented with
macros so they can be used in guards and matches
## Examples:
@Rob--W
Rob--W / dl-chrome.sh
Created January 23, 2014 12:03
Download a particular version of Google Chrome from Old Apps
#!/bin/sh
# @author Rob Wu <gwnRob@gmail.com> (https://robwu.nl)
version=$1
if [[ "${version}" != *"."* ]] ; then
echo "Repeat the command with an exact version:"
suffix="[0-9.]*"
# Version not specified in $1
[ -z $version ] && suffix="[0-9][0-9.]+"
curl -s http://www.oldapps.com/google_chrome.php | grep -oP "google_chrome.php\?old_chrome=[0-9]+\">[A-Za-z ]+\K${version}${suffix}( [A-Za-z()]+)?" -m 10
elif [ -e "${version}_chrome_installer.exe" ] ; then