Skip to content

Instantly share code, notes, and snippets.

View steve21124's full-sized avatar

Steve steve21124

  • san francisco
View GitHub Profile
@steve21124
steve21124 / gist:1584113
Created January 9, 2012 17:53
fayepubsub
{
"description": "Simple pub/sub messaging for the web",
"keywords": [
"comet",
"websocket",
"pubsub",
"bayeux",
"ajax",
"http"
],
@steve21124
steve21124 / gist:1584343
Created January 9, 2012 18:54
nodejitsu error
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Authenticated as steve21124
warn: There in no valid package.json file in /Users/steve/Projects/SourceCode/nodejs/FayeObj/nodechat2
warn: Creating package.json at /Users/steve/Projects/SourceCode/nodejs/FayeObj/nodechat2/package.json
help:
help: A package.json stores meta-data about your application
help: In order to continue we'll need to gather some information about your app
help:
@steve21124
steve21124 / gist:1599009
Created January 12, 2012 05:57
nodejitsu
spiderman56:nodechat2 steve$ jitsu deploy
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Authenticated as steve21124
warn: There in no valid package.json file in /Users/steve/Projects/SourceCode/nodejs/FayeObj/nodechat2
warn: Creating package.json at /Users/steve/Projects/SourceCode/nodejs/FayeObj/nodechat2/package.json
help:
help: A package.json stores meta-data about your application
help: In order to continue we'll need to gather some information about your app
@steve21124
steve21124 / gist:1599044
Created January 12, 2012 06:07
error nodejitsu
spiderman56:nodechat2 steve$ jitsu deploy
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Authenticated as steve21124
warn:
warn: Your package.json file is missing required fields:
warn:
warn: subdomain, scripts.start
warn:
Last login: Thu Feb 2 03:34:28 on ttys000
robinhood:~ steve$ cat ~/.railsrc
cat: /Users/steve/.railsrc: No such file or directory
robinhood:~ steve$ rvm current
ruby-1.9.2-p290@rails3
robinhood:~ steve$ rvm gemdir
/Users/steve/.rvm/gems/ruby-1.9.2-p290@rails3
robinhood:~ steve$ cd /Users/steve/.rvm/gems/ruby-1.9.2-p290@rails3
robinhood:ruby-1.9.2-p290@rails3 steve$ ls -al
total 0
2012-02-07 21:28:11.649 faceWrapper[30363:207] DETECTED photo tag: 999
2012-02-07 21:28:11.651 faceWrapper[30363:207] FACE DETECTED: {
attributes = {
gender = {
confidence = 77;
value = female;
};
glasses = {
confidence = 14;
value = false;
@steve21124
steve21124 / gist:4138340
Created November 24, 2012 04:25
function
jQuery(document).ready(function($){
var $masonry = $('#masonry');
$('#navigation').css({'visibility':'hidden', 'height':'1px'});
$masonry.masonry({
itemSelector : '.thumb',
isFitWidth: true
});
<?php
if (has_post_thumbnail()) {
$imgsrc = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'medium');
} elseif ($postimages = get_children("post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=0")) {
foreach($postimages as $postimage) {
$imgsrc = wp_get_attachment_image_src($postimage->ID, 'medium');
}
} elseif (preg_match('/<img [^>]*src=["|\']([^"|\'] )/i', get_the_content(), $match) != FALSE) {
$imgsrc[0] = $match[1];
} else {
#!/bin/bash
# mirrors and uploads a wordpress blog to a static web site
# check http://x-ian.net for details
# my configs
LOCAL_WORDPRESS=x-ian.net
REMOTE_WORDPRESS=x-ian.net
SSH_LOGIN=<your ssh credentials>
REMOTE_HTTP_DIR=x-ian.net
+ (void) createMovieFromImages:(NSString*) folderName file:(NSString *) fileName withSize:(CGSize)imageSize imageArray:(NSMutableArray*) imageArray {
int duration = 60.0; // Movie duration
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
NSString *myFilePath;
if([folderName length] == 0) {
myFilePath = [documentsDirectoryPath stringByAppendingPathComponent:fileName];
} else {
myFilePath = [[[[documentsDirectoryPath stringByAppendingString:@"/"] stringByAppendingString:folderName]
stringByAppendingString:@"/"] stringByAppendingString:fileName];