Skip to content

Instantly share code, notes, and snippets.

@thekoc
thekoc / tmux-cheatsheet.markdown
Created April 7, 2016 04:59 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@thekoc
thekoc / # octave - 2016-05-17_20-24-50.txt
Created May 18, 2016 00:11
octave (homebrew/science/octave) on Mac OS X 10.11.5 - Homebrew build logs
Homebrew build logs for homebrew/science/octave on Mac OS X 10.11.5
Build date: 2016-05-17 20:24:50
@thekoc
thekoc / GAME_MASTER_v0_1.protobuf
Created July 18, 2016 12:18 — forked from anonymous/GAME_MASTER_v0_1.protobuf
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@thekoc
thekoc / tem.sh
Last active October 11, 2016 09:50
echo 'import os
import sys
import shutil
def main():
root_path = sys.argv[1]
assert os.path.isdir(root_path)
assert len(os.listdir(root_path)) == 1000
@thekoc
thekoc / Sphinx.py
Created October 24, 2016 17:39
Sphinx
# 如果在冬夜,一个旅人
# 如果在冬夜,一个旅人
# 在马尔泊克镇外
# 从陡坡上斜倚下来
# 在逐渐累积的阴影中往下望
# …
input('what next?\n')
lines = """I am happy to join with you today in what will go down in history as the greatest demonstration for freedom in the history of our nation.
Five score years ago, a great American, in whose symbolic shadow we stand today, signed the Emancipation Proclamation. This momentous decree came as a great beacon light of hope to millions of Negro slaves who had been seared in the flames of withering injustice. It came as a joyous daybreak to end the long night of their captivity."""
def wrap_line(tokens):
if len(' '.join(tokens)) <= 80:
return ' '.join(tokens)
for i in range(len(tokens)):
if len(' '.join(tokens[:i+1])) > 80:
return ' '.join(tokens[:i]) + '\n' + wrap_line(tokens[i:])
# encoding=utf8
from __future__ import print_function
import multiprocessing
def heat():
print("I'm so hot")
while True:
pass
emacs_env = hs.hotkey.modal.new('', nil)
emacs_env:bind('alt', 'F', function() hs.eventtap.keyStroke({"alt"}, "right") end)
emacs_env:bind('alt', 'B', function() hs.eventtap.keyStroke({"alt"}, "left") end)
emacs_env:bind('alt', 'D', function() hs.eventtap.keyStroke({"alt"}, "forwarddelete") end)
emacs_env:bind('ctrl', 'N', function() hs.eventtap.keyStroke({}, 'down') end)
emacs_env:bind('ctrl', 'P', function() hs.eventtap.keyStroke({}, 'up') end)
emacs_env:bind('ctrl', 'U', function () hs.eventtap.keyStroke({'cmd'}, 'delete') end)
emacs_env:bind('ctrl', 'W', function () hs.eventtap.keyStroke({'alt'}, 'delete') end)
emacs_env:enter()
function callAlfred()
if (hs.window.focusedWindow():application():name() ~= "Alfred 3") then
hs.osascript.applescript('tell application "Alfred 3" to search')
hs.keycodes.setLayout("ABC")
else
hs.eventtap.keyStroke({}, "escape")
end
end
hs.hotkey.bind({"alt"}, "space", callAlfred)
//: Playground - noun: a place where people can play
import Cocoa
import CoreFoundation
//import PlaygroundSupport
//PlaygroundPage.current.needsIndefiniteExecution = true
class CurrencyConverter {