Skip to content

Instantly share code, notes, and snippets.

View bobspryn's full-sized avatar
🌴
On vacation

Bob Spryn bobspryn

🌴
On vacation
View GitHub Profile
@bobspryn
bobspryn / Assetfile.rb
Created February 16, 2012 23:04
AssetFile
require "json"
require "uglifier"
require "rake-pipeline-web-filters"
# this gives you concat, coffee_script, and minispade methods
require "rake-pipeline-web-filters/helpers"
class ImportFilter < Rake::Pipeline::Filter
def generate_output(inputs, output)
inputs.each do |input|
@bobspryn
bobspryn / keymando.rb
Created February 27, 2012 07:13
keymando.rb
only /Xcode/ do
map '<Cmd-d>', "<Cmd-Shift-l>" "<Delete>"
map '<Cmd-Option-Up>', "<Cmd-Shift-l>" "<Cmd-c>" "<Cmd-Left>" "<Cmd-v>" "<Up>"
map '<Cmd-Option-Down>', "<Cmd-Shift-l>" "<Cmd-c>" "<Cmd-Left>" "<Cmd-v>"
end
@bobspryn
bobspryn / gist:2296677
Created April 4, 2012 00:31
DataLoader.m
// Configuration elsewhere in the file
self.paginationMapping = [RKObjectMapping mappingForClass:[RKObjectPaginator class]];
[paginationMapping mapKeyPath:@"current_page" toAttribute:@"currentPage"];
[paginationMapping mapKeyPath:@"per_page" toAttribute:@"perPage"];
[paginationMapping mapKeyPath:@"total_entries" toAttribute:@"objectCount"];
// Object Mappings for Unit Pricing
self.unitPricingMapping = [RKManagedObjectMapping mappingForClass:[UnitPricingEntry class] inManagedObjectStore:self.objectManager.objectStore];
[unitPricingMapping mapKeyPath:@"id" toAttribute:@"unitPricingEntryId"];
[unitPricingMapping setPrimaryKeyAttribute:@"unitPricingEntryId"];
@bobspryn
bobspryn / gist:2553231
Created April 29, 2012 20:56
GetProductList
{
"ErrorCode":"String content",
"ErrorText":"String content",
"ResultCode":"String content",
"NextProcessDate":"String content",
"Products":[{
"ErrorCode":"String content",
"ErrorText":"String content",
"ResultCode":"String content",
"Product":{
@bobspryn
bobspryn / gist:2553234
Created April 29, 2012 20:57
GetProductList Obj-C
RKObjectMapping* productMapping = [RKObjectMapping mappingForClass:[CWProduct class]];
[productMapping mapKeyPathsToAttributes:@"Product.Id", @"productId", @"Product.ProductCode", @"productCode", @"Product.Name", @"name", @"Product.Description", @"descriptionText", @"Product.IsInBox", @"isInBox", @"Product.QtyInBox", @"quantityInBox", @"Product.Images", @"images", @"Product.Videos", @"videos", @"Product.Attributes", @"attributes", @"Product.Link", @"link", @"Product.Rating", @"rating", nil];
productMapping.rootKeyPath = @"Products";
// curl -XPOST -d "mid=4" http://feeds.clubw.com.asp1-1.dfw1-2.websitetestlink.com/mobile.svc/GetProductList
[objectManager.mappingProvider setObjectMapping:productMapping forResourcePathPattern:@"/mobile.svc/GetProductList"];
@bobspryn
bobspryn / gist:2553240
Created April 29, 2012 20:58
GetProductDetail
{
"ErrorCode":"String content",
"ErrorText":"String content",
"ResultCode":"String content",
"Product":{
"Attributes":[{
"Name":"String content",
"Value":"String content"
}],
"Description":"String content",
@bobspryn
bobspryn / echosign.py
Created July 18, 2012 04:41
Echosign Test
#!/usr/bin/python
import base64
import suds
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
url = "https://secure.echosign.com/services/EchoSignDocumentService14?wsdl"
client = suds.client.Client(url, autoblend=True)
@bobspryn
bobspryn / echosign.py
Created July 19, 2012 05:29
Working python file to create embedded echosign widget
#!/usr/bin/python
import base64
import suds
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
url = "https://secure.echosign.com/services/EchoSignDocumentService14?wsdl"
client = suds.client.Client(url, autoblend=True)
@bobspryn
bobspryn / gist:5230835
Last active December 15, 2015 08:29 — forked from Christopher-A/gist:2033205
Updated version makes sure the response code is 200. Also saves any possible false alarms to a file so we can evaluate how to fix those.
#!/bin/bash
api_key="your Prowl API key goes here"
cd ~
testSiteForChanges () {
ls "old_page.html" 1>/dev/null 2>/dev/null
if [ $? -eq "1" ] ; then
@bobspryn
bobspryn / calendar.json
Last active December 17, 2015 13:19
Calendar json
{
"id": 12,
"title": "Events",
"children": [{
"id": 14,
"title": "Congresses",
"children": [],
"events": [{
"start": "2013-12-07T17:45:48Z",
"end": "2013-12-10T16:59:59Z",