Skip to content

Instantly share code, notes, and snippets.

@leesei
leesei / jb-apps.md
Last active January 1, 2016 20:38
#ipad #cydia #jailbreak
App Link/Description
AdBlocker crack
AppSync for iOS7
AppCake AppCake HD depends on AppSync for iOS 5
BrowserChooser
Buka for iOS http://ios.ibuka.cn/
CyDelete7
iAPFree 4.0.1+ for iOS5
iAPFree Plugin Pack
@leesei
leesei / google-bookmark-to-json.js
Created December 18, 2013 03:50
#js #snippet google-bookmark-to-json
// first, visit google bookmark and jQuerify it
// convert bookmarks in the current page to json
// (paste to Chrome Dev Tools's Source -> Snippets, "Ctrl+Enter" to run)
function entry2Json(entry) {
return {
title: entry.innerText,
href: entry.href
};
}
@leesei
leesei / view-yuv.py
Created December 16, 2013 06:35
#python #view-yuv Load YUV file and render it using Pygame
#!/usr/bin/env python
import argparse
import os
import pygame
from pygame.locals import *
import sys
# constants
supported_formats = ('yv12', 'iyuv', 'i420', 'nv12', 'nv21')
@leesei
leesei / json2csv.js
Created December 16, 2013 06:01
#js #ya-csv #json2csv Convert JSON to CSV
#!/usr/bin/env node
var csv = require('ya-csv');
var path = require('path');
// load the json file
var json = require(path.resolve(process.argv[2]));
console.log(json);
console.log('');
@leesei
leesei / test.md
Last active December 28, 2015 21:19
test case for MarkdownEditing
// @262
// binder: surface->asBinder()/surfaceTexture->asBinder()
// window: surface/SurfaceTextureClient(surfaceTexture)
status_t CameraClient::setPreviewWindow(const sp<IBinder>& binder,
        sp<ANativeWindow> window)

This should be plain text.
But when this code is highlighted with Markdown GFM, the code block bleeds out.

@leesei
leesei / mdtoc.rb
Last active November 1, 2017 10:04 — forked from pyro2927/toc.rb
#ruby #markdown Generate TOC for markdown file
#!/usr/bin/env ruby
# sanity checks
if ARGV.count == 0
puts "You must provide a file name"
return
elsif File.exist?(ARGV.first) == false
puts "That file doesn't exist"
return
end
@leesei
leesei / path_parser
Created October 20, 2013 19:45
#bash #path_parser
#!/bin/bash
#
# path parsing function built purely from bash
# http://stackoverflow.com/a/18455930/665507
#
function path() {
SAVEIFS=$IFS; IFS="" # stash IFS for safe-keeping, etc.
[[ $# != 2 ]] && echo "usage: path <path> <dir|name|fullname|ext>" && return # demand 2 arguments
[[ $1 =~ ^(.*/)?(.+)?$ ]] && { # regex parse the path
@leesei
leesei / notepad2.reg
Created October 20, 2013 10:07
#notepad2 #registry #windows
Windows Registry Editor Version 5.00
# replaces notepad
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe]
"Debugger"="\"B:\\Program Files\\Notepad2\\Notepad2.exe\" /z"
# context menu shortcut
[HKEY_CLASSES_ROOT\*\shell\Open with Notepad2]
@="Open with &Notepad2"
@leesei
leesei / sublime-text-3.reg
Created October 20, 2013 10:07
#sublime #registry #windows
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\sublime]
@="Open Folder as &Sublime Project"
[HKEY_CLASSES_ROOT\Directory\shell\sublime\command]
@="\"B:\\Program Files\\Sublime Text 3\\sublime_text.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\sublime]
@="Open Folder as &Sublime Project"
@leesei
leesei / powershell.reg
Created October 20, 2013 10:04
#powershell #registry #windows
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\powershell]
@="Open &PowerShell Here"
[HKEY_CLASSES_ROOT\Directory\shell\powershell\command]
@="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell]
@="Open &PowerShell Here"