This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import base64 | |
import hashlib | |
import urllib | |
import urlparse | |
import urllib2 | |
import subprocess | |
from collections import OrderedDict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* @ngdoc function | |
* @name ntuconnectAngularApp.controller:MeetupCtrl | |
* @description | |
* # MeetupCtrl | |
* Controller of the ntuconnectAngularApp | |
*/ | |
angular.module('ntuconnectAngularApp') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |