Skip to content

Instantly share code, notes, and snippets.

View sarahstreza's full-sized avatar

Sarah Streza sarahstreza

View GitHub Profile
@sarahstreza
sarahstreza / __init__.py
Created March 4, 2011 06:29
Put this in ~/Library/Application Support/Plex Media Server/Plug-ins/MSNBC.bundle/Contents/Code/
import re, string
from PMS import *
MSNBC_PREFIX = "/video/msnbc"
MSNBC_NAMESPACE = {'v':'http://www.w3.org/2005/Atom', 'media':'http://search.yahoo.com/mrss/'}
MSNBC_URL = 'http://rss.msnbc.msn.com/id/'
CACHE_INTERVAL = 3600
###################################################################################################
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
@interface NSString (UUID)
+ (NSString*)stringWithNewUUID;
@end
@sarahstreza
sarahstreza / artist.rb
Created December 18, 2010 19:03
Migration
class Artist < ActiveRecord::Base
has_and_belongs_to_many :songs
end
@sarahstreza
sarahstreza / SwipeDown.m
Created November 16, 2010 08:36
How to handle swipe detection on iOS
-(void)setupGestureRecognizer{
UIView *myView = ...;
UISwipeGestureRecognizer *swipeDown = [[[UISwipeGestureRecognizer alloc] init] autorelease];
swipeDown.direction = UISwipeGestureRecognizerDirectionDown;
swipeDown.numberOfTouchesRequired = 2; // might need this because of the scroll view
[swipeDown addTarget:self action:@selector(handleSwipeDown:)];
[myView addGestureRecognizer: swipeDown];
}
{
"tracks": [
{
"title": "UKF Dubstep Tutorial",
"artist": "Dubba Jonny",
"seconds": 179,
"url": "http://d1msnxp21pi1n3.cloudfront.net/1%20-%20UKF%20Dubstep%20Tutorial%20(Dubba%20Jonny).mp3",
"albumArtURL": "http://i.ytimg.com/vi/CJzfTZlEl40/0.jpg"
},
{
//
// NSFileManager+BKExtensions.h
// BlocksKit
//
// Created by Steve Streza on 10/3/10.
// Copyright 2010 Steve Streza. All rights reserved.
//
#import <Foundation/Foundation.h>
var sys = require("sys");
var path = require("path");
var fs = require("fs");
var app = path.normalize(process.env["SWEARCH_APP"]);
var buildDir = path.normalize(process.env["CONFIGURATION_BUILD_DIR"] + "/" + process.env["CONTENTS_FOLDER_PATH"] + "/" + "app");
var builder = require(app + "/builder");
// this function call scans the supplied directory and prunes files out that aren't desired (e.g. PSDs)
#import <Foundation/Foundation.h>
#import <map>
class Http
{
private:
static std::map<NSURL *, Http*>sMap;
public:
void setURLFromCURL(const char *cURL);
npm it worked if it ends with ok
npm configfile /Users/sstreza/.npmrc
npm cli [ 'install', 'pcap' ]
npm version 0.1.20
npm install pkg pcap
npm fetch data pcap
npm GET pcap
npm ! Error: ECONNREFUSED, Connection refused
at IOWatcher.callback (net:871:22)