Skip to content

Instantly share code, notes, and snippets.

View taufikobet's full-sized avatar

Taufik Obet taufikobet

View GitHub Profile
@RuiAAPeres
RuiAAPeres / gist:11402456
Last active August 29, 2015 14:00
Sam Page's SparkRecording Implementation with Facebook's Pop
//The calculations are coming from [here](https://gist.github.com/d-ronnqvist/11266321) (thanks David!)
- (void)updateAnimations
{
CGFloat duration = self.duration * (1.f - [[self.progressLayers firstObject] strokeEnd]);
CGFloat strokeEndFinal = 1.f;
for (CAShapeLayer *progressLayer in self.progressLayers)
{
POPBasicAnimation *popEndAnimation = [POPBasicAnimation animation];
/**
* Wait for [AssestLibrary enumerateGroupsWithTypes: usingBlock:] to be completed, or how other
* people call it, [AssestLibrary enumerateGroupsWithTypes: usingBlock:] Asynchronous
* The following method should not be called on main thread, use
* [self performSelectorInBackground:@selector(getAllAssets) withObject:nil];
* to excecute it
*/
- (void)getAllAssets
anonymous
anonymous / Trie.swift
Created June 7, 2014 07:23
//
// Trie.swift
// SceneTest
//
// Created by Greg Titus on 6/7/14.
// Copyright (c) 2014 The Omni Group. All rights reserved.
//
// This is essentially the same data structure as OFTrie in OmniFoundation, except that the OmniFoundation version is mutable and ephemeral,
// and this version is immutable and persistent. Every time you add a string to the trie, it replaces all the nodes along the string's path
@0xced
0xced / MoviePlayerControllerDoneButton.h
Created December 17, 2014 09:54
Access the "Done" button of a MPMoviePlayerController
#import <MediaPlayer/MediaPlayer.h>
/**
* Example usage:
* UIButton *doneButton = MoviePlayerControllerDoneButton(moviePlayerViewController.moviePlayer);
* [doneButton setTitle:@"✖" forState:UIControlStateNormal];
* doneButton.titleLabel.font = [UIFont systemFontOfSize:30];
*/
extern UIButton * MoviePlayerControllerDoneButton(MPMoviePlayerController *moviePlayerController);
@dennisfarandy
dennisfarandy / ReactiveCocoaUtil.swift
Created August 5, 2015 09:31
some reactivecocoa util that colin eberhardt create, source : https://github.com/ColinEberhardt/ReactiveSwiftFlickrSearch
//
// RACSignal+Extensions.swift
// ReactiveSwiftFlickrSearch
//
// Created by Colin Eberhardt on 15/07/2014.
// Copyright (c) 2014 Colin Eberhardt. All rights reserved.
//
import Foundation
@mcxiaoke
mcxiaoke / NSData+AESCrypt.h
Created August 30, 2012 07:21 — forked from Harinder/NSData+AESCrypt.h
Adding methods to NSData and NSString using categories to provide AES256 encryption on iOS
//
// NSData+AESCrypt.h
//
// AES Encrypt/Decrypt
// Created by Jim Dovey and 'Jean'
// See http://iphonedevelopment.blogspot.com/2009/02/strong-encryption-for-cocoa-cocoa-touch.html
//
// BASE64 Encoding/Decoding
// Copyright (c) 2001 Kyle Hammond. All rights reserved.
// Original development by Dave Winer.
@ashikahmad
ashikahmad / BetterNSLog.md
Last active December 11, 2015 20:58
A quick replacement to NSLog in your Obj C project

#Better NSLog A quick replacement to NSLog in your Obj C project

This will need no extra effort at all and changes the way you see your logs in debug area.

###How it looks in Debug Area:

Before:

2013-01-29 15:46:24.076 Looptivity[76673:c07] ----2013-01-28 19:02:47 +0000
@shaps80
shaps80 / SPXGeometry.m
Created September 25, 2013 10:31
CGRectDivide with Padding
void CGRectDivideWithPadding(CGRect rect, CGRect *slide, CGRect *remainder, CGFloat amount, CGFloat padding, CGRectEdge edge)
{
CGRect rect1, rect2;
CGRectDivide(rect, &rect1, &rect2, amount, edge);
if (edge == CGRectMaxXEdge || edge == CGRectMaxYEdge)
{
CGRect tmp = rect1;
rect1 = rect2;
rect2 = tmp;
@brobertsaz
brobertsaz / serversetup.md
Last active January 4, 2016 18:28
Ubuntu Precise Rails, Nginx, Unicorn and Capistrano ('2.15.5') Server Setup

Ubuntu Precise Rails, Nginx, Unicorn and Capistrano ('2.15.5') Server Setup

I originally tried to use the ~> 3.0 version of Capistrano, but fell back to the 2.15.5 version. There were a lot of changes in the new version that I did not feel like learning right at the moment...

1. Setup deploy user

First we will create a new user for deployment:

$ ssh into your server

@dennisfarandy
dennisfarandy / swift
Created February 12, 2016 10:57
SwiftCurry
// LEARNING CURRYING
struct structA {
let a:Int
let b:Int
init(a:Int, b:Int) {
self.a = a
self.b = b
}
}