Skip to content

Instantly share code, notes, and snippets.

View nsantorello's full-sized avatar

Noah Santorello nsantorello

View GitHub Profile
@nsantorello
nsantorello / GetOAuth2Token.sh
Created October 5, 2011 20:45
Bash script to get the OAuth2 token for a user
#!/bin/bash
echo '* Installing oauth2 Ruby gem'
gem install oauth2
echo '* Done installing oauth2 gem'
echo ''
echo '* Enter your API ID:'
read apiid
echo '* Enter your API secret:'
@nsantorello
nsantorello / convert.sh
Created February 21, 2012 21:59
For iPhone devs: Create a halved version of this file, and rename the full-size version to @2x.
#!/bin/bash
FILE=$1
BASE=${FILE%.*}
EXT=${FILE##*.}
cp "$FILE" "${BASE}@2x.${EXT}"
WIDTH_RAW=`sips -g pixelWidth "$FILE" | sed -n 2p`
WIDTH=${WIDTH_RAW##*:}
HEIGHT_RAW=`sips -g pixelHeight "$FILE" | sed -n 2p`
HEIGHT=${HEIGHT_RAW##*:}
@nsantorello
nsantorello / IdGenerator.h
Created February 22, 2012 21:48
Random alphanumeric case-sensitive ID generator in Objective C
//
// IdGenerator.h
//
//
// Created by Noah Santorello on 2/22/12.
// Copyright (c) 2012 Noah Santorello. All rights reserved.
//
@interface IdGenerator : NSObject
@nsantorello
nsantorello / LoadingView.h
Created February 24, 2012 17:01
Great modal loading animation for iPhone.
//
// LoadingView.h
// LoadingView
//
// Created by Matt Gallagher on 12/04/09.
// Copyright Matt Gallagher 2009. All rights reserved.
//
// Permission is given to use this source code file, free of charge, in any
// project, commercial or otherwise, entirely at your risk, with the condition
// that any redistribution (in part or whole) of source code must retain
@nsantorello
nsantorello / modal_dialog.html
Last active December 15, 2015 14:38
A light-weight modal dialog for web pages
<html>
<head>
<style type="text/css">
.lightbox-container {
display:none;
}
#lightbox {
display:none;
background: #333333;
@nsantorello
nsantorello / README.md
Last active December 23, 2015 18:09 — forked from mbostock/.block
Removed all dark blues except for one

Bubble charts encode data in the area of circles. Although less perceptually-accurate than bar charts, they can pack hundreds of values into a small space. Implementation based on work by Jeff Heer. Data shows the Flare class hierarchy, also courtesy Jeff Heer.

@nsantorello
nsantorello / FrameParsingTests.java
Created October 2, 2013 17:00
How to test new COMMAND_CLASS_FIRMWARE_UPDATE_MD XML.
// Add this to FrameParsingTests.java
@Test
public void testPeterAddition() {
CommandData data;
VariantComponentData comp;
ArrayList<Byte> byteQueue = new ArrayList<Byte>();
byteQueue.addAll(Arrays.asList(new Byte[] { 0x01, 0x14, 0x00, 0x04, 0x00, 0x02, 0x0E, (byte)0x7A, 0x02, 0x01, 0x13, (byte)0x03, (byte)0x43, 0x00, 0x00, (byte)0xFF, 0x01, 0x00, 0x2C, 0x01, 0x00, 0x1A }));
ReceivedFrame frame = Frame.parseFrame(byteQueue);
@nsantorello
nsantorello / setup.sh
Last active December 24, 2015 17:19
Ubuntu setup
sudo apt-get install git curl
# install zsh and mods
cd ~
sudo apt-get install git-core highlight zsh perl
git clone git://github.com/miohtama/ztanesh.git ~/tools
~/tools/zsh-scripts/setup.zsh
zsh
chsh -s /bin/zsh $USER
@nsantorello
nsantorello / Instructions.md
Created October 22, 2013 16:22
OpenCV stream from raspberry pi
  1. Build display.cpp
  2. Set up pipe on Linux VM
  3. Run display application
  4. Run proxy/passthrough on Mac
  5. Start streaming from Raspberry Pi
@nsantorello
nsantorello / ContentfulLinkConverter.cs
Created December 15, 2014 18:12
JsonConverter for easily deserializing Contentful API responses with JSON.NET
using System;
using Newtonsoft.Json;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using System.Text;
namespace Grounded
{
public class ContentfulLinkConverter : JsonConverter
{