Skip to content

Instantly share code, notes, and snippets.

@psugihara
psugihara / hack.sh
Created April 1, 2012 16:34 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2276859/hack.sh | sh
#
info: Creating snapshot 0.0.0-14
error: Error running command push
error: Nodejitsu Error (500): Internal Server Error
warn: Error returned from Nodejitsu
error: Error: Unhandled error
error: at Object.onError (/root/nodejitsu/lib/nodejitsu.js:75:48)
error: at Router.invoke (/root/nodejitsu/node_modules/flatiron/node_modules/director/lib/director/router.js:359:18)
error: at /root/nodejitsu/node_modules/flatiron/node_modules/director/lib/director/router.js:47:9
error: at httpUsers.attach.app.requireAuth (/root/nodejitsu/node_modules/flatiron-http-users/lib/http-users.js:54:16)
error: at UserStrategy.authenticate (/root/nodejitsu/node_modules/flatiron-http-users/lib/http-users/auth.js:62:11)
NSArray *pathComponents = @[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject],
fileName];
NSURL *outputFileURL = [NSURL fileURLWithPathComponents:pathComponents];
AudioFileWriter *fileWriter = [[AudioFileWriter alloc]
initWithAudioFileURL:outputFileURL
samplingRate:_audioManager.samplingRate
numChannels:_audioManager.numInputChannels];
float data[_loopLength * _audioManager.numInputChannels];
_loopBuffer->FetchInterleavedData(data, _loopLength, _audioManager.numInputChannels);
[promiscuous] [receive] {"__amqp__":"/spree/product","type":"Spree::Product","ancestors":["Spree::Product"],"id":"1060500597","payload":{"name":"COPY OF Ruby on Rails Stein","description":"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla nonummy aliquet mi. Proin lacus. Ut placerat. Proin consequat, justo sit amet tempus consequat, elit est adipiscing odio, ut egestas pede eros in diam. Proin varius, lacus vitae suscipit varius, ipsum eros convallis nisi, sit amet sodales lectus pede non est. Duis augue. Suspendisse hendrerit pharetra metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur nec pede. Quisque volutpat, neque ac porttitor sodales, sem lacus rutrum nulla, ullamcorper placerat ante tortor ac odio. Suspendisse vel libero. Nullam volutpat magna vel ligula. Suspendisse sit amet metus. Nunc quis massa. Nulla facilisi. In enim. In venenatis nisi id eros. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc sit amet felis se
moped (1.4.3) lib/moped/bson/extensions/hash.rb:15:in `block in __bson_dump__'
moped (1.4.3) lib/moped/bson/extensions/hash.rb:14:in `each'
moped (1.4.3) lib/moped/bson/extensions/hash.rb:14:in `__bson_dump__'
moped (1.4.3) lib/moped/bson/extensions/hash.rb:15:in `block in __bson_dump__'
moped (1.4.3) lib/moped/bson/extensions/hash.rb:14:in `each'
moped (1.4.3) lib/moped/bson/extensions/hash.rb:14:in `__bson_dump__'
moped (1.4.3) lib/moped/bson/document.rb:36:in `serialize'
moped (1.4.3) lib/moped/protocol/message.rb:136:in `serialize_selector'
moped (1.4.3) lib/moped/protocol/message.rb:289:in `serialize'
moped (1.4.3) lib/moped/connection.rb:153:in `block in write'
@psugihara
psugihara / OLHelpPageViewController.swift
Created November 13, 2014 07:11
UIPageViewController in Swift using Interface Builder
//The MIT License (MIT)
//
//Copyright (c) 2014 Open Listings
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
@psugihara
psugihara / GradientView.swift
Created November 25, 2014 08:05
UIView with gradient background in Swift
class OLGradientView: UIView {
override class func layerClass() -> AnyClass {
return CAGradientLayer.self
}
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
initGradientLayer()
}
@psugihara
psugihara / gist:060bbd5c3fb94b5938ee
Created July 5, 2015 07:42
require pry atom snippet
# Paste this into your snippets file (in menu Atom > Open Your Snippets)
'.source.ruby':
'pry':
'prefix': 'pry'
'body': 'require "pry"\nbinding.pry'
key = full address
grouping properties.displayable by key
will_be_mutant = 0
iterating over groups with count > 1
check if properties are the same (sqft, lot_sqft)
if not the same, will_be_mutant ++
error = will_be_mutant / not_handled
![a8c54b32-39da-11e5-97d0-70d527bd8d68](https://cloud.githubusercontent.com/assets/282016/9069848/acca563e-3aa0-11e5-9401-c4d9c6e38563.jpg)