Skip to content

Instantly share code, notes, and snippets.

View warpling's full-sized avatar

Ryan McLeod warpling

View GitHub Profile
@city_fact = CityFact.new(city: @city,
text: params[:text],
position: params[:position],
fact_type: params[:fact_type],
icon_id: params[:icon_id])
@warpling
warpling / README.md
Last active May 17, 2019 21:42
D3 Force graph + voronoi trianguation

D3 Force graph + voronoi trianguation

@warpling
warpling / animate-custom.css
Last active December 31, 2015 07:29
Bored during finals presentations? Stop redditing and start playing CSC Presentation Bingo!
.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:1s;-moz-animation-duration:1s;-ms-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s;}.animated.hinge{-webkit-animation-duration:1s;-moz-animation-duration:1s;-ms-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s;}@-webkit-keyframes shake {
0%, 100% {-webkit-transform: translateX(0);} 10%, 30%, 50%, 70%, 90% {-webkit-transform: translateX(-10px);}
20%, 40%, 60%, 80% {-webkit-transform: translateX(10px);}
}
@-moz-keyframes shake {
0%, 100% {-moz-transform: translateX(0);}
10%, 30%, 50%, 70%, 90% {-moz-transform: translateX(-10px);}
20%, 40%, 60%, 80% {-moz-transform: translateX(10px);}
}
@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;
}