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
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
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf
File locations:
nginx.conf
to /usr/local/etc/nginx/
default.conf
and default-ssl.conf
to /usr/local/etc/nginx/sites-available
homebrew.mxcl.nginx.plist
to /Library/LaunchDaemons/
<request> | |
<dyn_variable name="authenticity_token" ></dyn_variable> | |
<http url="/registrations/new" version="1.1" method="GET"></http> | |
</request> | |
<request subst="true"> | |
<http url="/registrations" method="POST" version="1.1" | |
contents="authenticity_token=%%_authenticity_token%%&first_name=Jane"/> | |
</request> |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
Place phone call. | |
Home? | |
Leave message | |
Wait for callback | |
"Would you like to share a meal" | |
"Would you like to share a meal" | |
What is the response (A) ? | |
"Do you enjoy a hot beverage" | |
What is the response (B) ? | |
n = 0 |
def point_in_polygon?(polygonPoints) | |
return false if self.latitude.blank? or self.longitude.blank? | |
polygonPoints.each do |point| | |
point[0] = point[0].to_f | |
point[1] = point[1].to_f | |
end | |
contains_point = false | |
i = -1 | |
j = polygonPoints.size - 1 |
<% | |
# | |
# I originally needed to create a sidebar partial that had a div area where I could place custom links into. Finally found it. | |
# When I was trying to figure this out before and realized I needed to pass the view into :layout, rather than just using render 'layout'. Not sure why the block can't be passed otherwise but nonetheless... | |
# | |
# For explanation of options see | |
# http://guides.rubyonrails.org/layouts_and_rendering.html#options-for-render | |
# | |
%> |
#!/usr/bin/env ruby | |
# Load Rails | |
ENV['RAILS_ENV'] = ARGV[0] || 'production' | |
DIR = File.dirname(__FILE__) | |
require DIR + '/../config/environment' | |
# ... do stuff that requires using your rails models |
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |