Skip to content

Instantly share code, notes, and snippets.

@natemartinsf
natemartinsf / LinkButton.js
Created November 27, 2016 05:48
Wrapped @blueprintjs Button to work with React-Router
import React, {Component} from 'react';
import { Button } from '@blueprintjs/core';
import withRouter from 'react-router/lib/withRouter';
let typeOf = (o) => toString.call(o).slice(8, -1).toLowerCase();
function createLocationDescriptor({to, query, hash, state}) {
if (typeOf(to) === 'string') {
return {pathname: to, query, hash, state};
}
@natemartinsf
natemartinsf / gist:1947648
Created March 1, 2012 05:51
edited openocd formul
require 'formula'
class OpenOcd < Formula
url 'http://download.berlios.de/openocd/openocd-0.5.0.tar.bz2'
homepage 'http://openocd.berlios.de/web/'
md5 '43434c2b5353c9b853278b8bff22cb1a'
head 'git://openocd.git.sourceforge.net/gitroot/openocd/openocd'
depends_on 'libusb-compat'
@natemartinsf
natemartinsf / openocd head install problem
Created March 1, 2012 05:45
brew install -v $FORMULA output while install HEAD of openocd
Warning: open-ocd already installed
==> Installing open-ocd
==> Cloning git://openocd.git.sourceforge.net/gitroot/openocd/openocd
Updating /Users/nmartin/Library/Caches/Homebrew/open-ocd--git
git remote set-url origin git://openocd.git.sourceforge.net/gitroot/openocd/openocd
git fetch origin
git reset --hard origin/HEAD
HEAD is now at c59a441 stlink-v1: fix memory writes
git checkout-index -a -f --prefix=/private/tmp/homebrew-open-ocd-HEAD-0cPH/
git submodule init
@natemartinsf
natemartinsf / kvotest.j
Created May 28, 2011 03:45
KVO method firing twice
//Output:
/*
Frameworks/Debug/Objective-J/Objective-J.js:4322011-05-27 20:42:05.282 Cappuccino [info]: observed: attributeController.arrangedObjects change: {
CPKeyValueChangeKindKey = "1"
CPKeyValueChangeOldKey = "newArrayObject"
CPKeyValueChangeNewKey = "newArrayObject"
}
Frameworks/Debug/Objective-J/Objective-J.js:4322011-05-27 20:42:05.284 Cappuccino [info]: observed: attributeController.arrangedObjects change: {
CPKeyValueChangeKindKey = "1"
CPKeyValueChangeOldKey = "newArrayObject"
@implementation NMValidatedObjectProxy : CPProxy
{
NMValidatedObject _realObject;
BOOL isFault;
}
-(id)initWithValidatedObject:(NMValidatedObject)theObject
{
_realObject = theObject;
CPLog(@"testing return method - return value: %@", [testPosting testReturn]);
- (id)forwardInvocation:(CPInvocation)anInvocation
{
CPLog(@"Forwarding invocation from %@ to %@", self, _realObject);
var aSelector = [anInvocation selector];
if ([_realObject respondsToSelector:aSelector])
{
[anInvocation invokeWithTarget:_realObject];
CPLog(@"finished invocation");
class JobPostingsController < ApplicationController
# GET /job_postings
# GET /job_postings.xml
# GET /job_postings.json
def index
@job_postings = JobPosting.all
respond_to do |format|
#format.html # index.html.erb
format.json { render :json => @job_postings }
2009-11-13 20:48:52.310 Cappuccino: initing joblistcontroller
2009-11-13 20:48:52.312 Cappuccino: getting all test objects
2009-11-13 20:48:52.313 Cappuccino: fullPath: http://0.0.0.0:3000/job_postings
2009-11-13 20:48:52.350 Cappuccino: Could not connect the outlet jobListController of target of class AppController
2009-11-13 20:48:52.755 Cappuccino: receiving
2009-11-13 20:48:52.756 Cappuccino: receiving
2009-11-13 20:48:52.756 Cappuccino: [{"job_posting":{"created_at":"2009-12-02T05:56:45Z","title":"test title","company_name":"a name","updated_at":"2009-12-02T05:56:45Z","id":5,"description":"This is a description"}}]
2009-11-13 20:48:52.756 Cappuccino: [{"job_posting":{"created_at":"2009-12-02T05:56:45Z","title":"test title","company_name":"a name","updated_at":"2009-12-02T05:56:45Z","id":5,"description":"This is a description"}}]
@import <Foundation/CPObject.j>
@import "NMJobPosting.j"
@import "NMValidatedObjectContext.j"
@implementation NMJobListController : CPObject
{
//SNIP
NMValidatedObjectContext context;