Skip to content

Instantly share code, notes, and snippets.

View hboon's full-sized avatar
Indie hacking

Hwee-Boon Yar hboon

Indie hacking
View GitHub Profile
@hboon
hboon / using-ipsidekick-with-numbers-app.scpt
Last active October 15, 2017 14:49
Using IP Sidekick for geolocation in Numbers.app
//Using IP Sidekick for geolocation in Numbers.app
//hboon@motionobj.com
//https://ipsidekick.com
//Instructions:
//1. Save this file as using-ipsidekick-with-numbers-app.scpt in Script Editor.app
//2. In Numbers app, open your spreadsheet and select the cells with IP address
//..you want to lookup and run this script in Script Editor.app
@hboon
hboon / jsonp.js
Created July 14, 2017 07:42 — forked from gf3/jsonp.js
Simple JSONP in vanilla JS
/**
* loadJSONP( url, hollaback [, context] ) -> Null
* - url (String): URL to data resource.
* - hollaback (Function): Function to call when data is successfully loaded,
* it receives one argument: the data.
* - context (Object): Context to invoke the hollaback function in.
*
* Load external data through a JSONP interface.
*
* ### Examples
@hboon
hboon / pbkdf2test.c
Created November 11, 2016 21:05 — forked from lukhnos/pbkdf2test.c
An example of using CommonCrypto's PBKDF2 function
// an example of using CommonCrypto's PBKDF2 function
//
// build with:
//
// clang -o pbkdf2test pbkdf2test.c
//
// test with:
//
// ./pbkdf2test <some plaintext password here>
@hboon
hboon / custom.rb
Created November 2, 2016 06:25 — forked from gnestor/custom.rb
RubyMotion: Custom rake tasks for New Relic, Testflight (old), and Crittercism
def build_path
"build/iPhoneOS-7.0-Release/"
end
def ipa_name
"APP_FILE_NAME.ipa"
end
def dsym_name
"APP_FILE_NAME.app.dSYM"
Library not loaded: @rpath/libswiftos.dylib
Referenced from: /Applications/zXcode-8beta4.app/Contents/SharedFrameworks/libswiftFoundation.dylib
@hboon
hboon / fix-message
Created July 24, 2016 08:05
Reset iMessage badge when it's stuck at 1
#!/bin/bash
killall Messages
killall Dock
open -a Messages
@hboon
hboon / Apple Evangelists.txt
Created January 19, 2016 04:06 — forked from eternalstorms/Apple Evangelists.txt
Apple Evangelists (WWDC 2013)
UI- and App Frameworks Evangelist - Jake Behrens, behrens@apple.com, twitter: @Behrens
- What's new in Cocoa
- Accessibility in iOS
- Building User Interfaces for iOS 7
- Getting Started with UIKit Dynamics
- What's new in Cocoa Touch
- What's New With Multitasking
- Best Practices for Cocoa Animation
- Improving Power Efficiency with App Nap
- Introducing Text Kit
@hboon
hboon / gist:18cb1c14aae1a479bbad
Created January 19, 2016 04:06 — forked from eternalstorms/gist:4463450
Twitter Apple Accounts (media, pr, etc)
Steve Wozniak, Apple alumni and all-around amazing person - @stevewoz
Victor Agreda, Jr., TUAW - @superpixels
Mike T. Rose, TUAW - @miketrose
John Gruber, Daring Fireball - @gruber
Arnold Kim, MacRumors - @arnoldkim
Jason Snell, Macworld - @jsnell
Josh Lowensohn, CNET - @josh
Chris O'Brien, LA Times - @obrien
Mark Gurman, 9to5Mac - @markgurman
Matthew Panzarino, TNW - @panzer
@hboon
hboon / AVAsset+VideoOrientation.h
Created November 1, 2015 09:24 — forked from luca-bernardi/AVAsset+VideoOrientation.h
Find the video orientation of an AVAsset. (Useful if you need to send the video to a remote server)
//
// AVAsset+VideoOrientation.h
//
// Created by Luca Bernardi on 19/09/12.
// Copyright (c) 2012 Luca Bernardi. All rights reserved.
//
#import <AVFoundation/AVFoundation.h>
typedef enum {
LBVideoOrientationUp, //Device starts recording in Portrait
@hboon
hboon / Check iOS hardware model.m
Last active October 19, 2015 17:34
Check iOS hardware model
//Courtesy of https://github.com/InderKumarRathore/DeviceUtil/blob/master/DeviceUtil.m
- (NSString*)moHardwareDescription {
NSString *hardware = [self moHardwareString];
if ([hardware isEqualToString:@"iPhone1,1"]) return @"iPhone 2G";
if ([hardware isEqualToString:@"iPhone1,2"]) return @"iPhone 3G";
if ([hardware isEqualToString:@"iPhone2,1"]) return @"iPhone 3GS";
if ([hardware isEqualToString:@"iPhone3,1"]) return @"iPhone 4";
if ([hardware isEqualToString:@"iPhone3,2"]) return @"iPhone 4";
if ([hardware isEqualToString:@"iPhone3,3"]) return @"iPhone 4 (CDMA)";
if ([hardware isEqualToString:@"iPhone4,1"]) return @"iPhone 4S";