Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| 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 |
| /* ---------------------------------------------------------- */ | |
| /* */ | |
| /* A media query that captures: */ | |
| /* */ | |
| /* - Retina iOS devices */ | |
| /* - Retina Macs running Safari */ | |
| /* - High DPI Windows PCs running IE 8 and above */ | |
| /* - Low DPI Windows PCs running IE, zoomed in */ | |
| /* - Low DPI Windows PCs and Macs running Firefox, zoomed in */ | |
| /* - Android hdpi devices and above */ |
| var movementHistory = { | |
| pointAndTimeHistory: [], | |
| set: function(point) { | |
| // add this point into the point and time history for velocity calculations based on time & distance | |
| this.pointAndTimeHistory.push({ | |
| time: new Date().getTime(), | |
| x: point.x, | |
| y: point.y | |
| }); |
| var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
| /** | |
| * Adds "swipe" event support to Android, and adds swipe up and down to iOS. | |
| * @param view The view that should be made swipeable. | |
| * @param allowVertical Whether or not vertical swipes (up and down) are allowed; default is false. | |
| * @param tolerance How much further you need to go in a particular direction before swipe is fired; default is 2. | |
| */ | |
| function makeSwipeable(view, allowVertical, tolerance) { | |
| tolerance = tolerance || 2; |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # Rake task to launch multiple Resque workers in development/production with simple management included | |
| require 'resque/tasks' # Require Resque tasks | |
| namespace :workers do | |
| # = $ rake workers:start | |
| # | |
| # Launch multiple Resque workers with the Rails environment loaded, | |
| # so they have access to your models, etc. |
| // module dependencies | |
| var http = require('http'), | |
| url = require('url'); | |
| /** | |
| * UrlReq - Wraps the http.request function making it nice for unit testing APIs. | |
| * | |
| * @param {string} reqUrl The required url in any form | |
| * @param {object} options An options object (this is optional) |
| require 'sinatra' | |
| require 'redis' | |
| require 'json' | |
| require 'date' | |
| class String | |
| def &(str) | |
| result = '' | |
| result.force_encoding("BINARY") |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |