Skip to content

Instantly share code, notes, and snippets.

@jakejscott
jakejscott / HudView.m
Last active December 12, 2015 08:29
Simple HUD View for iOS
#import "HudView.h"
@implementation HudView {
}
+ (HudView *)hudInView:(UIView *)view animated:(BOOL)animated {
HudView *hudView = [[HudView alloc] initWithFrame:view.bounds];
hudView.opaque = NO;
@jakejscott
jakejscott / worker.js
Created March 5, 2013 22:23
IronWorker node.js script to download data from http://sidebar.io/api and import into Parse.com rest api
var _ = require('underscore');
var request = require('request');
var async = require('async');
var Parse = require('kaiseki');
var settings = require('./settings.json');
var parse = new Parse(settings.parseAppId, settings.parseRestApiKey);
request('http://sidebar.io/api', function (error, response, body) {
if (error) {
@jakejscott
jakejscott / Xamarin.Android
Created July 4, 2013 07:08
Xamarin async
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
@jakejscott
jakejscott / Macros.exs
Last active December 23, 2015 10:29
Playing around with Elixir macros
defmodule My do
defmacro if(condition, clauses) do
do_clause = Keyword.get(clauses, :do, nil)
else_clause = Keyword.get(clauses, :else, nil)
quote do
case unquote(condition) do
_ in [false, nil] -> unquote(else_clause)
_ -> unquote(do_clause)
@jakejscott
jakejscott / clear.bat
Created October 11, 2013 02:00
Get rid or those pesky bin/debug and bin/release folders
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S Release') DO RMDIR /S /Q "%%G" FOR /F "tokens=*" %%G IN ('DIR /B /AD /S Debug') DO RMDIR /S /Q "%%G"
@jakejscott
jakejscott / blog-post.tmpl
Last active December 29, 2015 12:09
martini form and render example
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1>Title: {{.Title}}</h1>
<p>Content: {{.Content}}</p>
@jakejscott
jakejscott / elastic-search-completion-suggestor
Created December 5, 2013 02:20
Elastic search completion suggestor (run this in sense)
PUT music
PUT music/song/_mapping
{
"song": {
"properties": {
"name": {
"type": "string"
},
"suggest": {
@jakejscott
jakejscott / server.go
Created February 12, 2014 07:11
oauth2 martini google
package main
import (
"github.com/codegangsta/martini"
"github.com/martini-contrib/oauth2"
"github.com/martini-contrib/sessions"
)
func main() {
m := martini.Classic()
@jakejscott
jakejscott / server.go
Created May 20, 2014 00:53
negroni + httprouter
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/julienschmidt/httprouter"
"net/http"
)
func main() {
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">