Skip to content

Instantly share code, notes, and snippets.

View gist:c84a2c25c081c023ba03
YapDatabaseViewGroupingWithObjectBlock groupingBlock = ^NSString *(NSString *collection, NSString *key, id object) {
if (![object isKindOfClass:[MealLogRemote class]]) {
return nil;
return "all"; // we only need one section/group in this case
YapDatabaseViewSortingWithObjectBlock sortingBlock = ^NSComparisonResult (NSString *group, NSString *collection1, NSString *key1, MealLogRemote *obj1,
NSString *collection2, NSString *key2, MealLogRemote *obj2){
// we don't need sorting but this using a sorting for a view is mandatory, lets sort it by date
taxilian / gist:1028036
Created Jun 15, 2011
modified jenkins launch plist
We couldn’t find that file to show.
chrisjaure / deploy.js
Created Jul 29, 2012
Deploying nodejs apps with haibu and git
View deploy.js
#! /path/to/node
var haibu = require('/path/to/haibu');
var client = new haibu.drone.Client();
process.stdin.on('data', function(data){
var package = JSON.parse(data.toString());
geoffgarside / GGChecksummingOutputStream.h
Created Dec 12, 2010
NSOutputStream subclass which updates a SHA1 checksum for all data written
View GGChecksummingOutputStream.h
// GGChecksummingOutputStream.h
// Created by Geoff Garside on 12/12/2010.
// Copyright 2010 Geoff Garside. All rights reserved.
#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h>
View MFBCollectionPreviewingAdapter.h
@import UIKit;
@protocol MFBPreviewableCollectionView
- (nullable NSIndexPath *)mfb_previewableCollectionIndexPathForItemAtPoint:(CGPoint)point;
- (CGRect)mfb_previewableCollectionItemRectForIndexPath:(NSIndexPath *)indexPath;
orta /
Created Mar 21, 2016
Fish versions of my bash commands from Lazy Automation
function git_branch_info
git branch ^/dev/null | grep \* | sed 's/* //'
function branch
git checkout master;
git pull upstream master;
git checkout -b $argv[1]
agibson73 / PulseTouchCollectionViewCell
Created Mar 12, 2017
Just a UICollectionview cell animation on touch although it could be performed on any uiview.
View PulseTouchCollectionViewCell
import UIKit
@IBDesignable class PulseTouchCollectionViewCell: UICollectionViewCell {
@IBInspectable var scaleFactor : CGFloat = 1.3
@IBInspectable var animationColor : UIColor =
@IBInspectable var startingOpacity : Float = 0.2
@IBInspectable var animationDuration : Double = 0.8
kashif /
Last active Jun 5, 2017
Initial implementation of Evolution Strategies
import numpy as np
import gym
from gym.spaces import Discrete, Box
from gym.wrappers import Monitor
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
# ================================================================
# Policies
andrewssobral /
Created Mar 26, 2017 — forked from karpathy/
Natural Evolution Strategies (NES) toy example that optimizes a quadratic function
A bare bones examples of optimizing a black-box function (f) using
Natural Evolution Strategies (NES), where the parameter distribution is a
gaussian of fixed standard deviation.
import numpy as np
# the function we want to optimize
palmerc / blur.m
Last active Oct 10, 2017
vImage Blur Example
View blur.m
- (UIImage *)boxblurImage:(UIImage *)image boxSize:(int)boxSize
CGImageRef originalImageRef = image.CGImage;
CGColorSpaceRef originalColorSpace = CGColorSpaceRetain(CGImageGetColorSpace(originalImageRef));
if (_pixelBuffer == NULL) {
_pixelBuffer = malloc(CGImageGetBytesPerRow(originalImageRef) * CGImageGetHeight(originalImageRef));
vImage_CGImageFormat inputImageFormat =