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
#!/usr/bin/env bash | |
# | |
# install all of http://github.com/phuibonhoa's TM bundles (OS X only) | |
# | |
echo "Installing bundles..." | |
# backup dir | |
if [ -d ~/desktop/_tm_bundle_backups ]; then rm -rf ~/desktop/_tm_bundle_backups; fi |
<!-- 1. Take your Campaign Monitor subscribe form as generated from within your account: --> | |
<form action="http://myaccount.createsend.com/t/r/s/aljhk/" method="post" id="subForm"> | |
<div> | |
<label for="name">Name:</label><br /><input type="text" name="cm-name" id="name" /><br /> | |
<label for="aljhk-aljhk">Email:</label><br /><input type="text" name="cm-aljhk-aljhk" id="aljhk-aljhk" /><br /> | |
<input type="submit" value="Subscribe" /> | |
</div> | |
</form> |
(function () { | |
var setupRegularResize, setupIframeResize, e; | |
function bind(a, b) { | |
return function () { | |
return a.apply(b, arguments); | |
}; | |
} | |
setupRegularResize = (function () { |
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'json' | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = "Usage: example.rb [options]" | |
opts.on("-x", "--extended", "Use awesome print") do |*| |
class Todo < ActiveRecord::Base | |
concerning :EventTracking do | |
included do | |
has_many :events | |
end | |
def latest_event | |
... | |
end |
# 1. in one file, assuming that Foo is loaded/auto-loaded | |
class Foo | |
def monkey_patch | |
# ... | |
end | |
end | |
# 2. later, the real Foo (in another file) is loaded | |
class Foo < File | |
end |
# -*- coding: utf-8 -*- | |
$:.unshift("/Library/RubyMotion/lib") | |
require 'motion/project' | |
Motion::Project::App.setup do |app| | |
# Use `rake config' to see complete project settings. | |
app.name = 'HelloMailCore' | |
# Configure MailCore | |
app.vendor_project("vendor/MailCore", :xcode, :headers_dir => "{../include,libetpan/build-mac/.build/include/libetpan}", :target => "MailCore iOS") |
require 'capybara/session' | |
# Provider `assert_page_has_X` helpers for all `has_X?` Capybara matchers | |
# | |
# For a full list, scope: | |
# https://github.com/jnicklas/capybara/blob/master/lib/capybara/session.rb | |
# | |
module CapybaraAssertions | |
Capybara::Session::DSL_METHODS.select { |m| m.to_s.match(/^has/) }.each do |m| | |
define_method "assert_page_#{m.to_s.sub(/\?$/, '')}" do |*args| |
# Utility class to help monitor open file descriptors | |
# | |
class FileDescriptorSentry | |
class << self | |
# Return a count of all open file descriptors in the current process. | |
# | |
def count_open_fds | |
ObjectSpace.each_object(IO).count { |o| o.respond_to?(:closed?) && !o.closed? rescue false } | |
end |