Skip to content

Instantly share code, notes, and snippets.

@g-liu
g-liu / settings.json
Last active October 2, 2016 05:00
Firefox RDM Extended presets
[{"name": "CGA: 320x200", "width": 320, "height": 200},
{"name": "QVGA: 320x240", "width": 320, "height": 240},
{"name": "CIF: 352x288", "width": 352, "height": 288},
{"name": "SIF: 384x288", "width": 384, "height": 288},
{"name": "HVGA: 480x320", "width": 480, "height": 320},
{"name": "VGA (NTSC): 640x480", "width": 640, "height": 480},
{"name": "PAL: 768x576", "width": 768, "height": 576},
{"name": "WVGA: 800x480", "width": 800, "height": 480},
{"name": "SVGA: 800x600", "width": 800, "height": 600},
{"name": "WVGA (NTSC): 854x480", "width": 854, "height": 480},
@g-liu
g-liu / namedcolors.json
Created June 19, 2014 22:38
CSS named colors
{
"aliceblue": "#f0f8ff",
"antiquewhite": "#faebd7",
"aqua": "#00ffff",
"aquamarine": "#7fffd4",
"azure": "#f0ffff",
"beige": "#f5f5dc",
"bisque": "#ffe4c4",
"black": "#000000",
"blanchedalmond": "#ffebcd",
@g-liu
g-liu / titin
Created December 20, 2014 04:46
full chemical name of titin
Methionylthreonylthreonylglutaminylarginyltyrosylglutamylserylleucylphenylalanylalanylglutaminylleucyllysylglutamylarginyllysylglutamylglycylalanylphenylalanylvalylprolylphenylalanylvalylthreonylleucylglycylaspartylprolylglycylisoleucylglutamylglutaminylserylleucyllysylisoleucylaspartylthreonylleucylisoleucylglutamylalanylglycylalanylaspartylalanylleucylglutamylleucylglycylisoleucylprolylphenylalanylserylaspartylprolylleucylalanylaspartylglycylprolylthreonylisoleucylglutaminylasparaginylalanylthreonylleucylarginylalanylphenylalanylalanylalanylglycylvalylthreonylprolylalanylglutaminylcysteinylphenylalanylglutamylmethionylleucylalanylleucylisoleucylarginylglutaminyllysylhistidylprolylthreonylisoleucylprolylisoleucylglycylleucylleucylmethionyltyrosylalanylasparaginylleucylvalylphenylalanylasparaginyllysylglycylisoleucylaspartylglutamylphenylalanyltyrosylalanylglutaminylcysteinylglutamyllysylvalylglycylvalylaspartylserylvalylleucylvalylalanylaspartylvalylprolylvalylglutaminylglutamylserylalanylprolylphenylalanyla
@g-liu
g-liu / tping
Created July 4, 2015 20:00
Ping with timestamp
#!/bin/bash
HOST=$@
ping $HOST | while read PONG
do
grep -q ttl <<< "$PONG"
if [ $? -eq 0 ]; then
echo "`date`: $PONG"
else
echo "$PONG"
fi
@g-liu
g-liu / js-ajax.sublime-snippet
Last active April 26, 2016 02:56
Code snippet for performing an Ajax request
<snippet>
<content><![CDATA[
var ${1:ajax} = new XMLHttpRequest();
${1:ajax}.onload = ${2:functionName};
${1:ajax}.onerror = ${3:errorFunctionName};
${1:ajax}.open("${4:GET}", "${5:url}", ${6:true});
${1:ajax}.send(${7});
function ${2:functionName}() {
if (this.status == 200) { // request succeeded
{
"name": "Minneapolis",
"state": "Minnesota",
"population": 480000
}