Skip to content

Instantly share code, notes, and snippets.

Avatar
🔨
Building

Nick Carneiro NickCarneiro

🔨
Building
View GitHub Profile
@NickCarneiro
NickCarneiro / Makefile
Created Dec 1, 2015
makefile for msp430 gcc on osx
View Makefile
OBJECTS=blink.o
GCC_DIR = ~/ti/gcc/bin
SUPPORT_FILE_DIRECTORY = ~/ti/gcc/include
DEVICE = msp430g2231
CC = $(GCC_DIR)/msp430-elf-gcc
GDB = $(GCC_DIR)/msp430-elf-gdb
CFLAGS = -I $(SUPPORT_FILE_DIRECTORY) -mmcu=$(DEVICE) -O2 -g
View blink.c
View gist:e803506a5294d620b0f0
### Keybase proof
I hereby claim:
* I am nickcarneiro on github.
* I am nickcarneiro (https://keybase.io/nickcarneiro) on keybase.
* I have a public key whose fingerprint is 7CA2 F1AE 21A6 7957 A63A 35E9 3192 F2DE 2F55 8B19
To claim this, I am signing this object:
@NickCarneiro
NickCarneiro / recruitfb.js
Created Aug 14, 2014
Snippet for finding devs on Facebook
View recruitfb.js
// 1) install jquery injector https://chrome.google.com/webstore/detail/jquery-injector/indebdooekgjhkncmgbkeopjebofdoid
// 2) using graph search, do something like "My friends of friends who live in San Francisco, California and studied Computer Science"
// 3) Run this in the chrome console
// 4) Paste the pipe-delimited output into a file
$('._1zf').each(function() {
var name = $(this).find('a').first().text().trim();
var employmentContainer = $(this).find('._pac');
var links = $(employmentContainer).find('a');
if (links.length === 1) {
@NickCarneiro
NickCarneiro / gist:5991987
Created Jul 13, 2013
HTML5 starter snippet with Bootstrap and jQuery.
View gist:5991987
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1" />
<title>untitled</title>
<link rel="stylesheet" href="static/css/" />
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
View economist mp3 renamer
import os
import sys
import shutil
if len(sys.argv) != 2:
print 'Usage: python economist_rename.py ~/path/to/mp3s'
sys.exit(0)
mp3_path = sys.argv[1]
if not mp3_path[-1:] == '/':
mp3_path += '/'
View gist:4704828
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$" />
<option name="settingsModule" value="settings.py" />
<option name="manageScript" value="manage.py" />
</configuration>
</facet>
@NickCarneiro
NickCarneiro / jpf_plugin_osx.txt
Created Apr 10, 2012
How to REALLY get the JPF eclipse plugin running on OSX
View jpf_plugin_osx.txt
1) Install the plugin using the instructions from the wiki.
Ensure that you are running Eclipse >= 3.5 (Galileo)
In Eclipse go to Help -> Install New Software
In the new window selected "Add"
The name is up to you but, set "Location" to http://babelfish.arc.nasa.gov/trac/jpf/raw-attachment/wiki/install/eclipse-plugin/update/
From the "Work with:" drop down menu select the update site that you just entered from the previous step
Check the "Eclipse-JPF" check box, select "Next" and go through the install process.
2) Download the jpf core binary and extract it somewhere: http://babelfish.arc.nasa.gov/trac/jpf/attachment/wiki/projects/jpf-core/jpf-core-r615.zip
@NickCarneiro
NickCarneiro / extract.py
Created Apr 3, 2012
Cap 10k parsing script
View extract.py
from bs4 import BeautifulSoup
#produce tab delimited CSV files from large html files
for year in range(2008, 2013):
print 'processing ' + str(year)
file = str(year) + '.html'
f = open(file, 'r');
html = f.read()
soup = BeautifulSoup(html)
table = soup.find("table")
View gist:2126997
package game;
import java.util.ArrayList;
public class RunningGame extends Minigame {
//introducing private entity
private IconEntity arrow_left;
private IconEntity arrow_right;
private IconEntity[] animations;