Skip to content

Instantly share code, notes, and snippets.

View nhnam's full-sized avatar
💭
Play hard, work harder

ナ-ム Nguyen nhnam

💭
Play hard, work harder
View GitHub Profile

Google Protobuf 2.5.0 - Mac OS X and iOS Support

The script in this gist will help you buid the Google Protobuf library for use with Mac OS X and iOS. Other methods (such as homebrew or direct compilation) have issues that prevent their use. The libraries built by this script are universal and support all iOS device architectures including the simluator.

Get the Script

The easiest way to use this script is to simply clone the gist onto your

#!/bin/bash
COMPRESS=1 # Compress if ImageOptim is intalled. 0 = disabled; 1 = enabled
iOSSubdir="/iOS" # make this an empty string to save in same dir
androidSubdir="/Android" # make this an empty string to save in same dir
help() {
echo ""
echo "Usage: ./$(basename "$0") <your_1024x1024.png>"
echo " --------------------------------------------------------------------------------------"
@nhnam
nhnam / gist:97a924ad559308bedb58
Created November 7, 2015 05:50 — forked from j3j5/gist:8b3e48ccad746b90a54a
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
06/2016 OR 08/2018 737 7373
//: Playground - noun: a place where people can play
import UIKit
class LLNode <T> {
var key: T!
var next: LLNode?
var prev: LLNode?
}
@nhnam
nhnam / GIF-Screencast-OSX.md
Created November 16, 2015 09:54 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@nhnam
nhnam / human.swift.motemplate
Created December 25, 2015 05:34 — forked from JoshuaSullivan/human.swift.motemplate
Better mogenerator Swift templates!
import Foundation
@objc(<$managedObjectClassName$>)
public class <$managedObjectClassName$>: _<$managedObjectClassName$> {
// Custom logic goes here.
}
@nhnam
nhnam / yosemite-sound-issues.md
Created January 20, 2016 07:25 — forked from mdwheele/yosemite-sound-issues.md
Fix Yosemite Bluetooth Sound Issues
  1. Run the following in your terminal.
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 80
//
// NSArray+Safe.h
// NNSafeArray
//
// Created by Nguyen Hoang Nam on 15/3/16.
// Copyright © 2016 Alan Nguyen. All rights reserved.
//
#import <Foundation/Foundation.h>
#!/bin/bash
set -e
echo
echo Preparing symbolic links for WebRTC...
echo
BUILD_FOLDER_CHROMIUM_DESTINATION=../webrtc-deps/chromium/build/
BORINGSSL_FOLDER_CHROMIUM_DESTINATION=../webrtc-deps/chromium/third_party/boringssl/src/
// TODO: improve the loop
void standardlizeParams(NSMutableDictionary* defaultParams) {
NSMutableDictionary *mutableDict = [defaultParams mutableCopy];
for (NSString *key in [defaultParams allKeys]) {
if ([defaultParams[key] isEqual:[NSNull null]] || [defaultParams[key] isEqual:@""]) {
[mutableDict removeObjectForKey:key];
NSLog(@" ✕ %@", key);
}
else if([defaultParams[key] isKindOfClass:[NSDictionary class]]) {
standardlizeParams(defaultParams[key]);