Skip to content

Instantly share code, notes, and snippets.

View warpling's full-sized avatar

Ryan McLeod warpling

View GitHub Profile
@warpling
warpling / gist:b3b8699a2e829c91ffdd
Created October 3, 2014 19:12
Stylebot CSS to make Loomio.org comments full-width
#content-comments {
width: 100%;
left: 0;
right: 0;
float: none;
}
#content-proposal {
width: 100%;
left: 0;
@warpling
warpling / gist:92d146fac8e0b1f95fdb
Last active August 29, 2015 14:07
Xcode's weird intendation
- (void) derp {
if (what) {
// this is stupid comment indenting
// It should be like this
[self turnDown];
}
}
@warpling
warpling / rspec failures
Last active August 29, 2015 14:08
Elasticsearch buffer
~/Code/OpenFarm () sudo elasticsearch
Password:
[2014-10-31 17:30:57,939][INFO ][node ] [Enforcer] version[1.2.1], pid[42230], build[6c95b75/2014-06-03T15:02:52Z]
[2014-10-31 17:30:57,941][INFO ][node ] [Enforcer] initializing ...
[2014-10-31 17:30:57,946][INFO ][plugins ] [Enforcer] loaded [], sites []
[2014-10-31 17:31:02,040][INFO ][node ] [Enforcer] initialized
[2014-10-31 17:31:02,040][INFO ][node ] [Enforcer] starting ...
[2014-10-31 17:31:02,335][INFO ][transport ] [Enforcer] bound_address {inet[/127.0.0.1:9300]}, publish_address {inet[/127.0.0.1:9300]}
[2014-10-31 17:31:05,456][INFO ][cluster.service ] [Enforcer] new_master [Enforcer][4izsESAJSy-OVrDxmUhLew][Elara][inet[/127.0.0.1:9300]], reason: zen-disco-join (elected_as_master)
[2014-10-31 17:31:05,486][INFO ][discovery ] [Enforcer] elasticsearch_ryanmcleod/4izsESAJSy-OVrDxmUhLew
@warpling
warpling / Pretty Device Identifiers
Created February 4, 2015 01:33
Apple Device Model Names (as of Jan 2015)
// Modified from: http://www.techrepublic.com/blog/software-engineer/better-code-determine-device-types-and-ios-versions/
+ (NSString *) platformRawString {
size_t size;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char *machine = malloc(size);
sysctlbyname("hw.machine", machine, &size, NULL, 0);
NSString *platform = [NSString stringWithUTF8String:machine];
free(machine);
return platform;
}
@warpling
warpling / Gemfile.lock
Last active August 29, 2015 14:17
Gemfile
GIT
remote: git://github.com/mongoid/mongoid.git
revision: 9ebf5854f2fd2c59594216913067886f0192b975
tag: v4.0.2
specs:
mongoid (4.0.2)
activemodel (~> 4.0)
moped (~> 2.0.0)
origin (~> 2.1)
tzinfo (>= 0.3.37)
@warpling
warpling / viewDidLoad
Created March 26, 2015 20:46
CATransformLayer Opacity Problem
- (void)viewDidLoad {
[super viewDidLoad];
// Make TransformLayer
CATransformLayer *transformLayer = [CATransformLayer layer];
transformLayer.frame = self.view.bounds;
transformLayer.anchorPoint = CGPointMake(0, 0);
// Make red layer
CALayer *redLayer = [CALayer layer];
@warpling
warpling / DictionaryProperties.h
Last active August 29, 2015 14:18
DictionaryProperties
//
// DictionaryProperties.h
//
// Created by KlausCPH on 3/1/13.
// Source: http://stackoverflow.com/a/15167563/522498
//
@interface DictionaryProperties : NSObject{
NSMutableDictionary* _backingDict;
}
@warpling
warpling / CAMediaTimingFunction+BasicFunctions.h
Last active August 29, 2015 14:24
CAMediaTimingFunctions Basic Functions
//
// CAMediaTimingFunction+BasicFunctions.h
//
//
// Created by Ryan McLeod on 7/1/15.
//
//
#import <QuartzCore/QuartzCore.h>
@warpling
warpling / Soundboard.h
Last active August 29, 2015 14:27
Soundboard - Using TheAmazingAudioEngine to play app sound effects
//
// Soundboard.h
//
//
// Created by Ryan McLeod on 8/19/15.
//
//
#import <Foundation/Foundation.h>
@city_fact = CityFact.new(city: @city,
text: params[:text],
position: params[:position],
fact_type: params[:fact_type],
icon_id: params[:icon_id])