These commands are good as of 2011-07-27.
App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.
These commands are good as of 2011-07-27.
App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.
package com.webile.basicauth; | |
import org.apache.http.HttpEntity; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.auth.AuthScope; | |
import org.apache.http.auth.UsernamePasswordCredentials; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.impl.client.DefaultHttpClient; | |
import org.apache.http.util.EntityUtils; |
[ | |
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" }, | |
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" } | |
] |
require 'mail' | |
class EmailValidator < ActiveModel::EachValidator | |
attr_reader :record, :attribute, :value, :email, :tree | |
def validate_each(record, attribute, value) | |
@record, @attribute, @value = record, attribute, value | |
@email = Mail::Address.new(value) | |
@tree = email.__send__(:tree) |
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
import sublime, sublime_plugin, os | |
class TailCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
from datetime import datetime | |
filtertext = "FLO" | |
# open sublime console | |
self.view.window().run_command("show_panel", { "panel": "console", "toggle": "true" }) |
Disclaimer: We are not affiliated with GitHub in any way! | |
Random Hacks of Kindness Berlin, Dec 2011 #RHoKbln | |
Project: Broken Lifts | |
Next steps: | |
Backend team | |
create database with static data |
require 'rubygems' | |
gem 'mysql2' | |
gem 'activerecord', '3.1.1' | |
require 'active_record' | |
# http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout | |
MYSQL_WAIT_TIMEOUT_MAX = 2147483 | |
# Testing the remote db connection after a 60s sleep | |
def test_connection(extra_conf = {}) |
#!/usr/bin/env sh | |
# Tidy up whitespace on commit. | |
# By-pass it with the --no-verify option to git commit | |
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |
#!/usr/bin/env ruby | |
# Get all tree entries from vienna's open data | |
# service and put them into a sqlite3 database. | |
# | |
# Peter Vasil | |
# Date: 2012-01-15 | |
require 'rubygems' | |
# require 'rexml/document' |