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
#! /usr/bin/env ruby | |
require 'csv' | |
require 'pp' | |
require 'readline' | |
require 'fileutils' | |
require 'rubygems' | |
require 'main' |
// force certain pages to be refreshed every time. mark such pages with | |
// 'data-cache="never"' | |
// | |
jQuery('div').live('pagehide', function(event, ui){ | |
var page = jQuery(event.target); | |
if(page.attr('data-cache') == 'never'){ | |
page.remove(); | |
}; | |
}); |
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
{ | |
"status": "OK", | |
"results": [ { | |
"types": [ "park", "establishment" ], | |
"formatted_address": "Kincaid Park, 6998 Raspberry Rd, Anchorage, Texas 99502, USA", | |
"address_components": [ { | |
"long_name": "Kincaid Park", | |
"short_name": "Kincaid Park", | |
"types": [ "establishment" ] | |
}, { |
#! /usr/bin/env ruby | |
# ClassMethods/InstanceMethods as modules are nice. but procs are mo betta. you can't do any of the following via modules. | |
# | |
module M | |
ClassMethods = proc do | |
class << self | |
alias_method 'bar', 'foo' | |
end |
#! /bin/sh | |
# file : ~/bin/favicon | |
# | |
# usage: favicon foo.png | |
convert "$@" -resize 16x16 favicon-16.png | |
convert "$@" -resize 32x32 favicon-32.png | |
convert "$@" -resize 64x64 favicon-64.png | |
convert "$@" -resize 128x128 favicon-128.png |
class A | |
attr_accessor :dsl | |
attr_accessor :state | |
def initialize | |
@state = [] | |
@dsl = self.class.dsl | |
sleep(rand) |
#! /usr/bin/env ruby | |
# this is best practice for writing mixins. the deferred evaluation is more | |
# powerful that the approach of ClassMethods/InstanceMethods as modules too | |
# | |
module Mixin | |
# put your class level code in here | |
# | |
ClassMethods = proc do |
#! /usr/bin/env ruby | |
require_relative '../lib/script.rb' | |
script { | |
help ' | |
HELP! | |
' | |
run { |