Skip to content

Instantly share code, notes, and snippets.

@nivertech
nivertech / app.rake
Created February 9, 2013 21:39 — forked from bleonard/app.rake
namespace :app do
desc "create a new app with the given name -- for example, app:create[new_app_name]"
task :create, [:name] => :environment do |t, args|
underscore = get_underscore(args)
name = underscore.camelize
directory = get_directory(args)
raise "#{directory} already exists!" if File.exists?(directory)
puts "Creating app #{name} in #{directory}"
### Most of the summary is taken from the awesome R twotorials at http://www.twotorials.com/ by Anthony Damico
### Some of it are my additions from my experience. This is intended so you can Ctrl+F and find what you want using
### common names of functions and concepts from other languages or statistics.
### Troubleshooting: Search http://tolstoy.newcastle.edu.au/R/ , http://www.r-bloggers.com/, http://www.rseek.org/
### Basics
traceback() # Get the call stack after an error, for debugging
32 %% 2 # == 0 mod operator
5 %/% 3 # == 1 integer division
#author: Davit Khaburdzania
#email: davit.khaburdzania@gmail.com
#github: github.com/davit-khaburdzania
fs = require "fs"
mongojs = require "mongojs"
db = mongojs 'mongodb://db_address', ['airports']
#countries in europe
eu_countries = ["austria", "belgium", "bulgaria", "cyprus", "czech republic", "denmark", "estonia", "finland", "france", "germany", "greece", "hungary", "ireland", "iceland", "italy", "latvia", "lithuania", "luxembourg", "malta", "netherlands", "norway", "poland", "portugal", "romania", "slovakia", "slovenia", "spain", "sweden", "switzerland", "united kingdom"]
@nivertech
nivertech / Sources
Created February 28, 2013 13:04 — forked from jpmens/Sources
PyWebsocket http://code.google.com/p/pywebsocket/
HTML from http://pedroassuncao.com/blog/2009/12/18/websockets-tutorialexample-with-pywebsocket/
@nivertech
nivertech / Makefile
Created March 3, 2013 13:27 — forked from seth/Makefile
DEPS = $(CURDIR)/deps
DIALYZER_OPTS = -Wunderspecs
# List dependencies that should be included in a cached dialyzer PLT file.
# DIALYZER_DEPS = deps/app1/ebin \
# deps/app2/ebin
DEPS_PLT = {{name}}.plt

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@nivertech
nivertech / Makefile
Created March 10, 2013 12:44 — forked from seth/Makefile
DEPS = $(CURDIR)/deps
DIALYZER_OPTS = -Wunderspecs
# List dependencies that should be included in a cached dialyzer PLT file.
# DIALYZER_DEPS = deps/app1/ebin \
# deps/app2/ebin
DEPS_PLT = {{name}}.plt
@nivertech
nivertech / a.md
Created March 14, 2013 22:39 — forked from martinrehfeld/a.md

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Netflix
  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
@nivertech
nivertech / pr.md
Created March 25, 2013 09:06 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

#!/usr/bin/env ruby
#
# Subscribe to BBC Radio 3 LiveText over MQTT
#
require 'rubygems'
require 'mqtt'
MQTT::Client.connect('test.mosquitto.org') do |c|
# If you pass a block to the get method, then it will loop