Skip to content

Instantly share code, notes, and snippets.

Wei-Shao Tang (Frank Tang) pa4373

Block or report user

Report or block pa4373

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pa4373
pa4373 / bcc.py
Last active Oct 19, 2019
不用開hichannel網頁也能聽中廣流行網
View bcc.py
#!/usr/bin/env python
import time
import base64
import hashlib
import urllib
import urlparse
import urllib2
import subprocess
from collections import OrderedDict
@pa4373
pa4373 / ptt-crawler.js
Last active Apr 30, 2016
ptt-crawler
View ptt-crawler.js
// npm i request cheerio json2csv
var fs = require('fs'),
request = require('request'),
cheerio = require('cheerio'),
json2csv = require('json2csv');
var HOST = 'https://www.ptt.cc';
var getMenu = function (url, callback, links) {
var links = links || []; // Set default value for links (initial call)
@pa4373
pa4373 / emacs.el
Created Apr 24, 2015
My emacs file, just getting started!
View emacs.el
;; package.el setup and auto install on new machine
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
(defvar local-packages '(auto-complete gotham-theme js2-mode markdown-mode pandoc-mode exec-path-from-shell projectile epc jedi))
(defun uninstalled-packages (packages)
(delq nil
@pa4373
pa4373 / controller.js
Last active Aug 29, 2015
Example angular.js coding style.
View controller.js
'use strict';
/**
* @ngdoc function
* @name ntuconnectAngularApp.controller:MeetupCtrl
* @description
* # MeetupCtrl
* Controller of the ntuconnectAngularApp
*/
angular.module('ntuconnectAngularApp')
@pa4373
pa4373 / groups.v
Created Oct 29, 2014
Some algebra proof about Group using Coq.
View groups.v
Section Group.
Variable G : Set.
Variable op : G -> G -> G.
Infix "o" := op (at level 35, right associativity).
Axiom assoc : forall a b c : G, a o (b o c) = (a o b) o c.
Variable e : G.
Axiom unit_l : forall a : G, e o a = a.
Axiom unit_r : forall a : G, a o e = a.
Axiom inv_l : forall a : G, exists b : G, b o a = e.
@pa4373
pa4373 / flip.py
Created Aug 20, 2014
Bit modification concept demonstration
View flip.py
'''
Usage:
$ python flip.py [SEED_NUMBER]
ex: python flip.py 3923
'''
import sys, random
message = [True, True, True, True, True, False, True, False]
carrier = [False, False, False, True, False, False, True, False, False, False, True, False, True, True, False]
View find_cryptid_offset.py
#!/usr/bin/env python
import os, sys, struct
def parse_arg(argv):
if len(argv) != 2:
print 'require one argument.'
elif not 'Mach-O' in [i.rstrip() for i in os.popen('file %s' % argv[1])][0]:
print 'the argument must be Mach-O binary file.'
else:
return argv[1]
View flip_cryptid.py
#!/usr/bin/env python
'''
This program simply flip cryptid to \x00, given offset.
WARNING: this will modify binary directly and without checking structure,
backup, and using with caution!
'''
import sys, os
def parse_arg(argv):
if len(argv) != 3:
@pa4373
pa4373 / gitbash_chifix.sh
Last active Aug 29, 2015
Fix chinese characters and input problem under Git Bash (MINGW32)
View gitbash_chifix.sh
# Usage: $ curl -L [GIST_RAW_URL] | sh
echo "alias ls='/bin/ls --show-control-chars -F --color=tty'" >> /etc/profile
sed -i -e "s/PS1=\"\$PS1\"'\\\n'/#PS1=\"\$PS\"'\\\n'/g" /etc/profile
echo "set meta-flag on\nset input-meta on\nset output-meta on\nset convert-meta off" >> /etc/inputrc
You can’t perform that action at this time.