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| # 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. |
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| 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; |
| 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 | |
| }); |
| /* ---------------------------------------------------------- */ | |
| /* */ | |
| /* 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 */ |
| 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 |
| class API::V1::BaseController < ApplicationController | |
| skip_before_filter :verify_authenticity_token | |
| before_filter :cors_preflight_check | |
| after_filter :cors_set_access_control_headers | |
| def cors_set_access_control_headers | |
| headers['Access-Control-Allow-Origin'] = '*' | |
| headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
| //courtesy: http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/ | |
| angular.module('session', ['$strap.directives'], setPostHeader) | |
| //angular def (router, run ect | |
| /** | |
| * Set default header AJAX Angular agar bisa dibaca oleh PHP lewat POST | |
| * @param $httpProvider | |
| */ | |
| function setPostHeader($httpProvider) { |
| // Node.js CheatSheet. | |
| // Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
| // Download: http://nodejs.org/download/ | |
| // More: http://nodejs.org/api/all.html | |
| // 0. Synopsis. | |
| // http://nodejs.org/api/synopsis.html |