Skip to content

Instantly share code, notes, and snippets.

View ToroLiu's full-sized avatar

Aecho Liu ToroLiu

  • Hsinchu, Taiwan
View GitHub Profile
@ToroLiu
ToroLiu / example_spooky.js
Created March 26, 2018 05:29
Spooky, userAgen example
spooky.start();
spooky.userAgent('whateverUserAgent');
spooky.thenOpen('https://www.google.com');
@ToroLiu
ToroLiu / centos-install-casper.sh
Last active August 9, 2017 08:53
In order to install casper in CentOS
#!/bin/sh
## Preconditions
# phantomjs prerequisites, see https://www.bonusbits.com/wiki/HowTo:Install_PhantomJS_on_CentOS
yum install fontconfig freetype freetype-devel fontconfig-devel libstdc++
# for bunzip2
yum install bzip2
# for git
yum install git
@ToroLiu
ToroLiu / sample.html
Created June 21, 2017 05:38
CSS for tutorial guide
<head>
<style>
h1 {
color: #1366a0;
font-size: 19px;
text-align: center;
}
p {
text-align: left;
font-size: 17px;
@ToroLiu
ToroLiu / pandocMarkdown.css
Last active April 25, 2017 07:29
CSS for pandoc, from markdown syntax.
@font-face {
font-family: octicons-anchor;
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhDwCs7QgGAAAAIgKIAAAAAf//AAJ4nHWMMQrCQBBF/0zWrCCIKUQsTDCL2EXMohYGSSmorScInsRGL2DOYJe0Ntp7BK+gJ1BxF1stZvjz/v8DRghQzEc4kIgKwiAppcA9LtzKLSkdNhKFY3HF4lK69ExKslx7Xa+vPRVS43G98vG1DnkDMIBUgFN0MDXflU8tbaZOUkXUH0+U27RoRpOIyCKjbMCVejwypzJJG4jIwb43rfl6wbwanocrJm9XFYfskuVC5K/TPyczNU7b84CXcbxks1Un6H6tLH9vf2LRnn8Ax7A5WQAAAHicY2BkYGAA4teL
@ToroLiu
ToroLiu / gitcheats.txt
Created August 23, 2016 02:44 — forked from chrismccoy/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# get most modified files and counts
git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count\tfile"} {print $1 "\t" $2}' | sort -g
# Locally checkout all remote branches of a repository
git branch -r | cut -d '/' -f2 | grep -Ev '( |master)' | xargs -Ibranch git checkout -b branch origin/branch
# Open current Git repository URL
@ToroLiu
ToroLiu / 00_WebApiClient_01.cs
Last active August 29, 2015 13:59
For asp.net WebAPI client. Enable cookies and trust HTTPS certification any way.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net;
using System.Diagnostics;
@ToroLiu
ToroLiu / 0_getDateString.pas
Created November 13, 2013 06:26
Get current DateString
#define MyDate GetDateTimeString('yymmdd','','')
@ToroLiu
ToroLiu / 0_innosetup_auto_uninstall.pas
Created November 13, 2013 06:10
Auto uninstall before setup.
/////////////////////////////////////////////////////////////////////
function GetUninstallString(): String;
var
sUnInstPath: String;
sUnInstallString: String;
begin
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
sUnInstallString := '';
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
@ToroLiu
ToroLiu / 0_reuse_code.js
Created November 13, 2013 06:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console