Skip to content

Instantly share code, notes, and snippets.

View lightory's full-sized avatar

LIGHT lightory

View GitHub Profile
{"sig":"7792a834deccd626d65c89a20b4fcd2eb6780d131d7824783dad8bbe49b82f1338d9d5b842a2d3dee281a6495941e8d0a78083987ca7164e98af8c661120f9080","msghash":"6235031f39419e6b864c75f30614d41ae491db277b6e85e0b7738aca891eff32"}
### Keybase proof
I hereby claim:
* I am lightory on github.
* I am lightory (https://keybase.io/lightory) on keybase.
* I have a public key ASDmDPzaL8J_w2piDRoFaXdM7wt6tOjh94bCjbO6D-z7owo
To claim this, I am signing this object:
@lightory
lightory / crawl_yupoo.rb
Created June 28, 2016 14:05
抓取又拍网特定用户的所有照片
require 'open-uri'
require 'Nokogiri'
require 'digest/sha1'
def main
username = "lightory"
base_url = "http://www.yupoo.com/photos/" + username + "/albums/"
doc = Nokogiri::HTML(safe_open(base_url))
#!/bin/sh
# Current as working as of 2012/4/17
# Xcode 4.3.2
PROJECT_ROOT="$HOME/SomeDirWhereYourProjectLives/XXXXXXXX"
WORKSPACE="$PROJECT_ROOT/XXXXXXXX.xcodeproj/project.xcworkspace"
CONFIG="AdHoc"
SCHEME="XXXXXXXX"
@lightory
lightory / UIViewAdditions.m
Created October 16, 2012 02:10
UIViewAdditions
#import "UIViewAdditions.h"
CGContextRef createBitmapContext(int pixelsWide, int pixelsHigh)
{
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGBitmapInfo bitmapInfo = (kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst);
CGContextRef bitmapContext = CGBitmapContextCreate(nil, pixelsWide, pixelsHigh, 8, 0, colorSpace, bitmapInfo);
CGColorSpaceRelease(colorSpace);
return bitmapContext;
# Uncrustify 0.59
#
# General options
#
# The type of line endings
newlines = auto # auto/lf/crlf/cr
# The original size of tabs in the input