Skip to content

Instantly share code, notes, and snippets.

express = require 'express'
lessMiddleware = require 'less-middleware'
moment = require 'moment'
content = require './content-manager'
app = express()
app.configure ->
app.set 'views', __dirname + '/views'
app.set 'view engine', 'jade'
app.use("/styles", lessMiddleware({ src: __dirname + '/styles'}))
@willwhitney
willwhitney / audobox-feedback-menu-demo.java
Last active December 20, 2015 17:28
A snippet demonstrating how to add Audobox Feedback to your app's menu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(
Menu.NONE, // Not part of a group
1990, // ID for the menu item (arbitrary, must match the case below)
Menu.NONE, // Order (set higher than other items to be lower in menu)
"Send feedback"); // Title for the menu item
return true;
}
@willwhitney
willwhitney / audobox-setup.java
Last active December 20, 2015 21:38
All the code it takes to get feedback with Audobox!
Audobox.createFeedbackDialog(this)
.withApiKey(your_api_key)
.show();
@willwhitney
willwhitney / audobox-permissions.xml
Created August 16, 2013 18:43
Permissions Audobox needs to run.
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE"/>
@willwhitney
willwhitney / actionbar_style.xml
Created September 18, 2013 23:23
android tab style
<style name="retroTabStyle" parent="@android:style/Widget.Holo.ActionBar.TabView">
<item name="android:showDividers">none</item>
<item name="android:measureWithLargestChild">true</item>
<item name="android:background">@drawable/tabs_background_selector</item>
<item name="android:gravity">center</item>
<item name="android:layout_weight">1</item>
</style>
<style name="retroTabBar" parent="@android:style/Widget.Holo.ActionBar.TabBar">
<item name="android:showDividers">middle</item>
@willwhitney
willwhitney / gist:e08a90c78d552ab9a4a8
Created April 30, 2015 15:49
Diff of unnecessarily brutal changes to get DC-IGN working without GPU
diff --git a/config.lua b/config.lua
index c1b1cb2..93c6984 100644
--- a/config.lua
+++ b/config.lua
@@ -1,6 +1,6 @@
require 'modules/prequire'
require 'modules/UnPooling'
-cunn_mod = prequire('cunn')
+-- cunn_mod = prequire('cunn')
--Global variables for config
@willwhitney
willwhitney / api.md
Last active February 12, 2016 18:45
Hydrogen Language Plugin API

Hydrogen Language Plugin API

Registering Your Provider

When your package is activated, a function called "myProviderFunctionName" in your package's main file [1] will be run, and it should return a Language Provider object as specified below.

[1] Your main file is specified by the "main" field of your package.json.

"providedServices": {
@willwhitney
willwhitney / dirty.js
Last active August 29, 2015 14:26
a dirty private method
publicMethods = ['bark']
class Dog {
constructor() {
_secret = new Dog();
_.forOwn(this, (value, key) => {
if (_.isFunction(value)) {
if (_.contains(publicMethods, key)) {
@willwhitney
willwhitney / himawari.py
Last active November 30, 2022 17:47 — forked from celoyd/hi8-fetch.py
Fetch and untile tiled Himawari-8 images from the http://himawari8.nict.go.jp PNG endpoint, then set them as desktop background on OSX
import requests
import sys
from datetime import datetime, timedelta
import pytz
from PIL import Image
from StringIO import StringIO
import os
import logging
# python himawari.py
@willwhitney
willwhitney / propublica_per_capita.js
Last active May 13, 2016 04:19
Getting per-state per capita usage numbers from https://projects.propublica.org/checkup with jank javascript.
/*
To use me, go to one of the individual drug pages from propublica (e.g. https://projects.propublica.org/checkup/drugs/1726),
open the console (press ⌘-⌥-J on Mac),
paste in this script and hit Enter.
A new column should appear in your table.
This is very much hacked together in the console, so... no guarantees it will work next week.
*/
states = [[1, "California", 39144818],