Skip to content

Instantly share code, notes, and snippets.

View isair's full-sized avatar

Baris Sencan isair

View GitHub Profile
@tomohisa
tomohisa / gist:2897676
Created June 8, 2012 19:20
Add and Remove ChildViewController
// add child view
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"];
[self addChildViewController:controller];
controller.view.frame = CGRectMake(0, 44, 320, 320);
[self.view addSubview:controller.view];
[controller didMoveToParentViewController:self];
// remove child view
UIViewController *vc = [self.childViewControllers lastObject];
[vc.view removeFromSuperview];
@tmoertel
tmoertel / gist:5798134
Last active April 8, 2024 21:34
How to transform the vanilla recursive fib function into the iterative DP version through a series of mechanical steps.
# Transforming the vanilla recursive fib into the iterative DP version
# through a series of mechanical steps.
#
# For more on converting recursive algorithms into iterative ones, see:
# http://blog.moertel.com/posts/2013-05-11-recursive-to-iterative.html
# original function
def fib(n):
@branneman
branneman / better-nodejs-require-paths.md
Last active October 18, 2024 20:29
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@komasaru
komasaru / TwitterStream.cpp
Created November 24, 2014 03:11
C++ source code to get twitter timelines by Twitter Streaming API.
/*
* Getting timelines by Twitter Streaming API
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <oauth.h>
#include <curl/curl.h>
@c00kiemon5ter
c00kiemon5ter / brew-cask-upgrade.sh
Last active July 3, 2022 04:02
a portable shell script to upgrade cask packages
#!/bin/sh
help=0
latest=0
verbose=0
status=0
usage() {
cat <<-EOF
${0##*/} [options]
@ostinelli
ostinelli / jenkins_ci_on_osx.md
Last active February 28, 2023 02:38
Setup Jenkins CI on OSX.

Jenkins CI on OSX

Instructions on how to setup a secured Jenkins CI on a Mac.

Download & Install dependencies

All of these operations are done with your admin user.

Developer tools

Install the command line developer tools.

@davbeck
davbeck / GQL.swift
Created May 2, 2015 15:52
GraphQL data structure implemented in Swift
import Foundation
protocol GQLNodeArgument {}
extension String: GQLNodeArgument {}
extension NSNumber: GQLNodeArgument {}
class GQLNode: StringLiteralConvertible, ArrayLiteralConvertible, Printable, DebugPrintable {
let name: String?
@Sut3kh
Sut3kh / PTT.ahk
Created May 18, 2015 11:07
Global Push to Talk Autohotkey script
; create and run 'SOUNDCARD ANALYSIS.ahk' from https://www.autohotkey.com/docs/commands/SoundSet.htm
; screenshot and close window
; mute the microphone in Recording > Properties > Levels
; run 'SOUNDCARD ANALYSIS.ahk' again and find the row where MUTE has changed to 'On'
; replace [#MIXER_ID] with changed row, i.e. 'SoundSet $val, Master, Mute, 11'
SS( $val )
{
SoundSet $val, Master, Mute, [#MIXER_ID]
}
@mwilliammyers
mwilliammyers / eclim.rb
Created September 13, 2015 04:20
eclim Homebrew formula
class Eclim < Formula
desc "Eclim provides the ability to access Eclipse code editing features via the command line or favorite editor (eg. VIM)"
homepage "http://eclim.org/index.html"
url "http://sourceforge.net/projects/eclim/files/eclim/2.4.1/eclim_2.4.1.jar", :using => :nounzip
sha256 "289ba3643a1193edfc68bf042043f4847995733eecb23e2077f49f39c51a1527"
head "git://github.com/ervandew/eclim.git"
#keg_only "..."