Skip to content

Instantly share code, notes, and snippets.

@itsPG
itsPG / sublime
Created April 20, 2015 12:39
sublime
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"default_line_ending": "unix",
"font_face": "monaco",
"font_size": 12,
"ignored_packages":
[
"Vintage"
],
"trim_trailing_white_space_on_save": true
@itsPG
itsPG / gitconfig
Created April 20, 2015 12:35
gitconfig
[user]
name = PG
email = smartPG@gmail.com
[core]
editor = vim
[alias]
st = status
ci = commit
co = checkout
br = branch
@itsPG
itsPG / _orihime_dmhy_download_v2_prototype.js
Last active August 29, 2015 14:14
_orihime_dmhy_download_v2_prototype.js
var dump = require('utils').dump;
var und = require('underscore');
var fs = require('fs');
var g_task_list = [];
var g_dmhy_url = 'http://share.dmhy.org';
var g_persistent_time = 10000; // main thread will wait XXX ms
function call_cb(callback, scope, args) {
if (typeof(callback) === 'function') {
callback.apply(scope || window, args);
@itsPG
itsPG / pcre.cpp
Last active August 29, 2015 14:07
#define OVECCOUNT 30 /* should be a multiple of 3 */
#define EBUFLEN 128
#define BUFLEN 1024
int main()
{
pcre *re;
const char *error;
int erroffset;
int ovector[OVECCOUNT];
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
# Python OAuth example
import evernote.edam.userstore.constants as UserStoreConstants
import evernote.edam.type.ttypes as Types
from evernote.api.client import EvernoteClient
##
# Helper function to turn query string parameters into a
# Python dictionary
##
Maxtor 120G (已有壞軌)
Maxtor 120G
Hitachi 200G
WD 500G
Seagate 320G
Hitachi 320G
WD 640G
Seagate 500G (家用)
WD 1T (已有壞軌)
Hitachi 1T
@itsPG
itsPG / md5.js
Last active August 29, 2015 14:00
/*
md5.js
Original version from Joseph Myers' implementation.
Modified by PG Tsai @ Synology Inc.
The original version is implemented by Joseph Myers.
You may download it from http://www.myersdaily.org/joseph/javascript/md5-text.html
I only made some modification to make it more appropriate for the general use.
(My modification is ) released under the MIT license.
@itsPG
itsPG / gist:8858692
Last active November 10, 2018 16:02

畢業出清 全部半價以下出清 大約是2.5折~4.x折的價格 剛考完的N2成績單:http://i.imgur.com/ELD8Nss.png

1.考上日檢N3的文法筆記本 原290 考上日檢N3的單字筆記本 原290 全新未用 原價580 售 250

2.考上日檢N2的文法筆記本 原290

@itsPG
itsPG / arena.cpp
Last active January 4, 2016 09:28
/*
勝率70%的話,打競技場十勝以上的機率是25%左右,12勝機率是16%
拿實況主hcm的戰績來驗證一下想法
改版後參加競技場次數:73, win:497, lose:209, 勝率70.5%
十勝以上次數:19次,12勝次數:8次
按照機率算:
參加次數73次的話,約有18.25次可以拿到十勝以上,11.68次可以拿到12勝
而實際次數分別是19次以及8次
不可否認勝率打到後面會越來越低因此12勝的機率會比預測的少