Skip to content

Instantly share code, notes, and snippets.

View Person.m
#import <objc/runtime.h>
#import <Foundation/Foundation.h>
@interface Person : NSObject
@end
@implementation Person
@end
@interface Person(dynamicProperties)
@puttin
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
@puttin
puttin / genDiff.sh
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](http://puttin.github.io/2013/04/18/view-code-with-your-ipad-and-git/)
View genDiff.sh
#!/bin/bash
#default: diff last 2 commit
count=2
#default: check next commit
upordown=1
while getopts "u:d:" arg
do
case $arg in
@puttin
puttin / README.md
Last active Dec 22, 2015
Some tools may possibly help you to watch WWDC 2013 videos.
View README.md

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.

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))
prevs.removeAtIndex(0)
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\/BaiduIM.app\/Contents\/MacOS\/BaiduIM",
@puttin
puttin / reveal_build_phase.sh
Last active Sep 18, 2019
Reveal App build phase
View reveal_build_phase.sh
#!/bin/bash
# see also http://support.revealapp.com/kb/getting-started/load-the-reveal-server-via-an-xcode-breakpoint
# remove Debug check; change framework path; simplify
# find original one in Reveal.app
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}"
@puttin
puttin / SSR_subscribe_to_Surge_External.py
Last active Mar 13, 2020
parse SSR subscribe to Surge Mac External list
View SSR_subscribe_to_Surge_External.py
#!/usr/bin/env python3
import sys
import requests
import base64
# https://github.com/shadowsocksr-backup/shadowsocks-rss/wiki/SSR-QRcode-scheme
# usage: $0 https://example.com/list '/usr/local/bin/ss-local'
subscribe_url = sys.argv[1]
exec_path = sys.argv[2]
@puttin
puttin / Gemfile
Last active Jun 28, 2020
fetch WWDC HD videos' download links
View Gemfile
source 'https://rubygems.org'
gem 'httparty'
gem 'nokogiri'
gem 'pry'