Skip to content

Instantly share code, notes, and snippets.

@imranansari
imranansari / phonegap.html
Created December 24, 2011 03:10 — forked from pamelafox/phonegap.html
Phonegap Index (Jinja2)
<!doctype html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>everyday.io</title>
{% if g and g.debug %}
<link rel="stylesheet" href="css/colorslider.css" />
<link rel="stylesheet" href="css/dateinput.css" />
<link rel="stylesheet" href="css/bootstrap-1.3.0.min.css">
@imranansari
imranansari / Additional Commands
Created February 29, 2012 22:37 — forked from vinioliveira/Additional Commands
Init.d Juggernaut2 script for Ubuntu
$ sudo adduser --system --no-create-home --disabled-login --disabled-password --group juggernaut
$ sudo mv ~/juggernaut2-for-init.d-startup.sh /etc/init.d/juggernaut
$ sudo chmod +x /etc/init.d/juggernaut
$ sudo update-rc.d -f juggernaut defaults
@imranansari
imranansari / juggernaut_channels.rb
Created June 26, 2012 12:20 — forked from maccman/juggernaut_channels.rb
Sinatra Server Side Event streaming with private channels.
# Usage: redis-cli publish message.achannel hello
require 'sinatra'
require 'redis'
conns = Hash.new {|h, k| h[k] = [] }
Thread.abort_on_exception = true
get '/' do
@imranansari
imranansari / touch.css
Created September 13, 2012 12:11 — forked from jlongster/touch.css
Web Audio API demo (iOS 6, Chrome) - The Web is a Platform
html, body {
background-color: black;
width: 100%;
height: 100%;
margin: 0;
}
canvas {
display: block;
margin: 0;
class MyController < UIViewController
def viewDidLoad
super
top_view.addSubview chart_view([[0,0], [100,100],
[10, 20, 20, 15, 35],
["#203a65", "#37537c", "#5b7faa", "#aec2d6", "#aec2d6", "#ffffff"]
)
end
def chart_view(frame, data, colors)
//
// StickyHeaderLayout.h
// Wombat
//
// Created by Todd Laney on 1/9/13.
// Copyright (c) 2013 ToddLa. All rights reserved.
//
// Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS!
//
@imranansari
imranansari / Rakefile
Created February 10, 2013 16:56 — forked from alloy/Rakefile
desc "Create a new version tag and push a new podspec"
task :release do
require 'cocoapods'
require 'colored'
version = Pod::Specification.from_file(Pathname.pwd + 'MyLib.podspec').version
puts "Releasing version `#{version}'. Is that correct? (y/n)"
if $stdin.gets.strip.downcase == 'y'
sh "git tag -a #{version} -m 'Release #{version}'"
sh "git push --tags"
sh "pod lint"

RubyMotion #inspect 2013 Traveling Guide

Overview

This document is a travel guide to RubyMotion's first conference, #inspect 2013.

http://www.rubymotion.com/conference

If you are attending or considering attending the conference, you might find here some handy tips that will answer questions you might have. If you have a question that isn't answered here, feel free to contact us and we will update this document accordingly.

class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
PXEngine.licenseKey('YOUR SERIAL', forUser:'YOUR USER')
@button = UIButton.buttonWithType(UIButtonTypeRoundedRect)
@button.styleId = "myButton"
@button.frame = [[100, 100], [80, 40]]
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.addSubview(@button)

The Pinterest Graph

This GraphGist is inspired by the blog Building a follower model from scratch, kudos to the Pinterest Engineers!

The model

The basic model is just users following users, something like the following.