Skip to content

Instantly share code, notes, and snippets.

@hikerpig
hikerpig / qiandao_casper.coffee
Last active May 22, 2017 14:40
用casperjs暴力签到虾米。
utils = require('utils')
fs = require('fs')
casper = require("casper").create(
verbose: true
logLevel: "warning" # 想看更详细的log的话可以改成"debug"
pageSettings:
loadImages: false
loadPlugins: false
userAgent: "Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0"
@hikerpig
hikerpig / 0_reuse_code.js
Created April 22, 2014 02:28
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
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
@hikerpig
hikerpig / require_formatter.vim
Created May 23, 2014 08:55
Coffeescript require formatter vim plugin
" Prettify coffee require statement
" Maintainer: asnowwolf<[email protected]>
" Last Change: 2014-01-01
if exists("g:loaded_require_formatter")
finish
endif
let g:loaded_require_formatter = 1
function s:format()
@hikerpig
hikerpig / ssh_to.sh
Created December 29, 2014 09:09
Setup a ssh session that can utilize the remote server's clipboard.
PORT=5566
ssh_server='ubuntu@crmdev'
# using mac
if [[ -n `which pbcopy` ]]; then
echo "@Mac"
copy_command='pbcopy'
elif [[ -n `which xsel` ]]; then
echo "you can use xsel on ubuntu"
copy_command='xsel'
@hikerpig
hikerpig / index.html
Created January 13, 2015 07:30
三角测试 // source http://jsbin.com/tuvonu
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>三角测试</title>
<style id="jsbin-css">
.dropdown a {
padding: 10px;
background: #aa4599;
position: relative;
@hikerpig
hikerpig / require_formatter.txt
Last active August 29, 2015 14:19
Tiny vimscript to align the require statement in js/coffee
if exists("g:loaded_require_formatter")
finish
endif
let g:loaded_require_formatter = 1
"Function: :format
"Desc: align the require statement
"
func! s:format()
python << EOF
@hikerpig
hikerpig / cloudSettings
Last active October 16, 2021 13:02
vscode sync
{"lastUpload":"2021-10-16T13:02:35.750Z","extensionVersion":"v3.4.3"}
@hikerpig
hikerpig / useful-commands.sh
Last active July 12, 2018 08:53
Shell commands
# Show the size of files under current directory(recursively) in bytes, and sort them in numeric order
find . | xargs -I _ stat -f "%z %N" _ | sort -n
@hikerpig
hikerpig / delete_branches.sh
Last active June 27, 2018 03:59
Git snippets #tags:bash
#!/usr/bin/env bash
cat remote_branches.txt | xargs -I 'Branch' git push origin :Branch