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.
| 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 = {}) |
| 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 |
| 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" }) |
| 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 |
| 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) |
| [ | |
| { "keys": ["ctrl+shift+x"], "command": "tidy_xml" }, | |
| { "keys": ["ctrl+shift+j"], "command": "prettify_json" } | |
| ] |
| 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; |
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.
| #!/usr/bin/python | |
| # Script for adding ignore rules to gitignore files. | |
| # | |
| # Peter Vasil | |
| # Date: 2011-03-11 | |
| import sys | |
| from optparse import OptionParser |
| #!/usr/bin/python | |
| # Script for generating a software version code(hex) from a version string. | |
| # | |
| # Usage e.g $ python CreateVersionNumber.py 1.4.2" | |
| # | |
| # Peter Vasil | |
| # Date: 2011-02-15 | |
| from optparse import OptionParser |