Skip to content

Instantly share code, notes, and snippets.

puttin / Gemfile
Last active Jun 28, 2020
fetch WWDC HD videos' download links
View Gemfile
source ''
gem 'httparty'
gem 'nokogiri'
gem 'pry'
puttin /
Last active Mar 13, 2020
parse SSR subscribe to Surge Mac External list
#!/usr/bin/env python3
import sys
import requests
import base64
# usage: $0 '/usr/local/bin/ss-local'
subscribe_url = sys.argv[1]
exec_path = sys.argv[2]
puttin /
Last active Sep 18, 2019
Reveal App build phase
# see also
# remove Debug check; change framework path; simplify
# find original one in
set -e
REVEAL_APP_PATH=$(mdfind kMDItemCFBundleIdentifier="com.ittybittyapps.Reveal2" | sort | head -n 1)
[ ! -e "${REVEAL_APP_PATH}" ] && echo "warning: Reveal Server not loaded: Cannot find a compatible Reveal app." && exit 0
echo "Found Reveal at ${REVEAL_APP_PATH}"
View Ban Input Methods.lsrules
"description" : "",
"name" : "Ban Input Methods",
"rules" : [
"action" : "deny",
"creationDate" : 1460985349.190908,
"modificationDate" : 1549857179.580241,
"owner" : "me",
"process" : "\/Library\/Input Methods\/\/Contents\/MacOS\/BaiduIM",
View RecurrenceRelation.swift
struct RecurrenceRelation<Element>: SequenceType, GeneratorType {
private var prevs: [Element]
private let relat: ([Element], Int) -> Element
private var i: Int = 0
mutating func next() -> Element? {
guard i == prevs.endIndex else { return prevs[i++] }
prevs.append(relat(prevs, i))
puttin /
Last active Dec 22, 2015
Some tools may possibly help you to watch WWDC 2013 videos.

Where Is The Name?

Be careful before you use these tools.

#What's this? what's this?

Some tools may possibly help you to watch WWDC 2013 videos.

puttin /
Created Apr 19, 2013
a shell script help me to view code diff on my jailbreak iPad. View more detail on [View code with your iPad and git](
#default: diff last 2 commit
#default: check next commit
while getopts "u:d:" arg
case $arg in
puttin / LineLayout.h
Created Apr 9, 2013
An advanced example about the UICollectionView and custom layout NEED QuartzCore.framework
View LineLayout.h
File: LineLayout.h
Abstract: Simple flow layout to lay out items in a line.
Version: 1.0
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
View Person.m
#import <objc/runtime.h>
#import <Foundation/Foundation.h>
@interface Person : NSObject
@implementation Person
@interface Person(dynamicProperties)