Skip to content

Instantly share code, notes, and snippets.

View stursby's full-sized avatar

Charlie Hield stursby

  • Minneapolis, MN
View GitHub Profile
@stursby
stursby / _info.md
Last active August 29, 2015 14:01
Beer Advocate API to CSV demo

To run this demo.

  1. Make a new folder mkdir test && cd test

  2. Install packages npm install

  3. Run the app.js file node app.js

@stursby
stursby / AppDelegate.m
Last active August 29, 2015 14:01
Cocoa NSPasteboard polling
@implementation AppDelegate {
NSInteger lastChangeCount;
NSPasteboard *pasteboard;
}
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
pasteboard = [NSPasteboard generalPasteboard];
[NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(checkPasteboard:) userInfo:nil repeats:YES];
}
@stursby
stursby / notes.txt
Created July 31, 2014 15:12
Pagekit install
1. clone the repo
git clone git://github.com/pagekit/pagekit.git && cd pagekit
2. install composer
curl -s getcomposer.org/installer | php -d detect_unicode=Off
3. run components install
php composer.phar install
4. boot local server
@stursby
stursby / notes.md
Last active August 29, 2015 14:05
High performance animations on mobile

Position : transform: translate(npx, npx);

Scale : transform: scale(n);

Rotation: transform: rotate(ndeg);

Opacity: opacity: 0...1;

@stursby
stursby / hooks.m
Last active August 29, 2015 14:09
↩️ Hooks (http://hooks.events)
// by @itskathuria
NSURL *url = [NSURL URLWithString:@"http://hooks.events/hooks/post.php"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
NSString *apiKey = @"yourAPIKeyShouldGoHere";
NSString *title = @"yourTitleShouldGoHere";
NSString *message = @"yourMessageShouldGoHere";
NSString *query = [NSString stringWithFormat:@"hooksTitle=%@&hooksMessage=%@&hooksApi=%@", title, message, apiKey];
@stursby
stursby / camera.py
Last active August 29, 2015 14:11
Raspberry Pi stuff
import picamera
camera = picamera.PiCamera()
camera.capture('image.jpg')
@stursby
stursby / .htaccess
Created January 9, 2015 21:40
HttpBasicAuth on FastCGI
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
@stursby
stursby / Console.md
Last active August 29, 2015 14:14
Plangular

Getting the following Console error:

http://api.soundcloud.com/resolve.json?callback=angular.callbacks._0&client_id=0d33361983f16d2527b01fbf6408b7d7&url=soundcloudURL

I'm guessing it's because the directive is running before the Firebase call retuns the URL... so how do I reload the plangular directive? Or defer loading the directive until I have the SoundClour URL because the URL will be different for each room.

@stursby
stursby / README.md
Created March 8, 2015 20:24
fightbulc/moment incorrect month format demo
  1. Create a folder & cd into that folder.
  2. Install Composer or curl -sS https://getcomposer.org/installer | php
  3. Install packages php composer.phar install
  4. Run the app php app.php

Sample Output

2015-03-08T15:14:53-0500 // correct
Sunday, 08th April 2015 / 15:14 (America/Chicago) // wrong month
Sunday, 08th March 2015 / 15:14 (America/Chicago) // correct month
@stursby
stursby / selectors.md
Created March 17, 2015 19:14
Weird selectors
  • :-webkit-autofill remove autofill input yellow background Demo