Skip to content

Instantly share code, notes, and snippets.

@pi-chan
pi-chan / compareUIImage.m
Last active December 14, 2016 12:52
compare uiimage by md5 hash
- (void)md5HashFromUIImage:(UIImage*)image
hash:(unsigned char*)hash
{
CGDataProviderRef dataProvider = CGImageGetDataProvider(image.CGImage);
NSData *data = (NSData*)CFBridgingRelease(CGDataProviderCopyData(dataProvider));
CC_MD5([data bytes], [data length], hash);
}
- (BOOL)compareUIImages:(UIImage*)image1
image:(UIImage*)image2
@pi-chan
pi-chan / rssi.rb
Created November 21, 2013 11:23
Check Wi-FI RSSI(Received Signal Strength Indicator) on OS X.
#!/usr/bin/env ruby
require 'nokogiri'
def scan_wifi
xml = `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s -x`
doc = Nokogiri::XML(xml)
system 'clear'
puts "## #{Time.now.to_s}"
results = []
Pod::Spec.new do |s|
s.name = 'JSONKit'
s.version = '1.5pre2'
s.license = 'BSD / Apache License, Version 2.0'
s.summary = 'A Very High Performance Objective-C JSON Library.'
s.homepage = 'https://github.com/johnezang/JSONKit'
s.author = 'John Engelhart'
s.source = { :git => 'https://github.com/SpacyRicochet/JSONKit.git', :commit => 'b942b7eee06583a57895ee1953e7bab87df2b0c4' }
s.source_files = 'JSONKit.*'
$ DEBUG_RESOLVER=true bundle install --gemfile /home/deploy/apps/appname/releases/20130524020935/Gemfile --path /home/deploy/apps/appname/shared/bundle --deployment --binstubs --without test development deploy --verbose
Fetching from: https://rubygems.org/api/v1/dependencies
HTTP Redirection
Fetching from: https://bundler.rubygems.org/api/v1/dependencies
HTTP Success
Fetching source index from https://rubygems.org/
Fetching from: https://rubygems.org/quick/Marshal.4.8/actionmailer-4.0.0.beta1.gemspec.rz
HTTP Redirection
Fetching from: https://bb-m.rubygems.org/quick/Marshal.4.8/actionmailer-4.0.0.beta1.gemspec.rz
HTTP Success