Skip to content

Instantly share code, notes, and snippets.

@mywarr
mywarr / PTTWebAutoAIDLink.user.js
Created June 12, 2018 13:45 — forked from dannvix/PTTWebAutoAIDLink.user.js
自動為 PTT 網頁版的文章代碼加上連結的 userscript
@mywarr
mywarr / .prettierrc
Created April 4, 2018 04:46
.prettierrc
{
"printWidth": 120,
"singleQuote": true,
"useTabs": false,
"tabWidth": 2,
"semi": true,
"bracketSpacing": true
}
@mywarr
mywarr / ramdisk.sh
Created March 13, 2018 06:07 — forked from rxin/ramdisk.sh
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@mywarr
mywarr / index.html
Created March 26, 2015 13:20
typeWriter.js
<div class="wrap">
<a href="#" class="start">Click to print</a>
<div class="test" data-text="帝旺 則取 2014/1/12 為目標日期,並取 前4天2014/1/8開始 到後4天 2014/1/16 結束 共取9 天"></div>
</div>
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
@mywarr
mywarr / AccessDump.py
Last active December 1, 2023 08:21
use mdbtools to convert .mdb to .sqlite and .csv
#!/usr/bin/env python
#
# AccessDump.py
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
# http://sourceforge.net/projects/mdbtools/
import sys, subprocess, os
DATABASE = sys.argv[1]
@mywarr
mywarr / gist:8663897
Created January 28, 2014 08:17
textfile processing notes sed etc..
remove empty lines
sed -i '/^[[:space:]]$/d' *.md
convert crlf to cr aka dos to unix with tr command.
for f (*.md) {tr -d '\r' < $f > $f_Without_CR.md}
@mywarr
mywarr / glyphs
Last active December 18, 2015 13:29
special characters
“   &#8220; opening double quote
”   &#8221; closing double quote
‘   &#8216; opening single quote
’   &#8217; closing single quote
–   &#8211; en dash
—   &#8212; em dash
−   &#8722; minus
×   &times; multiplication
...   &#8230; ellipsis
@mywarr
mywarr / gist:5110179
Last active December 14, 2015 15:48
Remove all installed gems at once
gem list | cut -d" " -f1 | xargs gem uninstall -aIx