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
require 'prawn/measurement_extensions.rb' | |
class StandardBriefB < Prawn::Document | |
def initialize(*args) | |
super( | |
:page_size => 'A4', | |
:page_layout => :portrait, | |
:margin => [107.4.mm, 8.1.mm, 30.mm, 24.1.mm] | |
) | |
options = args.last.is_a?(Hash) ? args.last : {} |
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
require 'nokogiri' | |
RSpec::Matchers.define :have_xpath do |*paths| | |
match do |doc| | |
!doc.xpath(*paths).empty? | |
end | |
end | |
def within *paths, &block | |
describe "within #{paths.inspect}" do |
# Use git and git+ssh instead of https | |
[url "git://github.com/"] | |
insteadOf = https://github.com/ | |
[url "[email protected]:"] | |
pushInsteadOf = "git://github.com/" | |
[url "[email protected]:"] | |
pushInsteadOf = "https://github.com/" |
This playbook has been removed as it is now very outdated. |
require 'net/http' | |
# WARNING do not use this; it works but is very limited | |
def resolve url | |
res = Net::HTTP.get_response URI(url) | |
if res.code == '301' then res['location'] | |
else url.to_s | |
end | |
end |
env = (function() { | |
var flags = {}, ua = navigator.userAgent, el = document.createElement('div'), video = document.createElement('video'), audio = document.createElement('audio'), root = document.documentElement, i | |
function flag(names) { | |
names = names.split(' ') | |
for (i = 0; i < names.length; i++) | |
flags[names[i]] = true | |
} | |
function classnames() { | |
var names = [], name | |
for(name in flags) if (flags.hasOwnProperty(name)) |
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
ActiveAdmin.register Project do | |
# Don't forget to add the image attribute (here thumbnails) to permitted_params | |
controller do | |
def permitted_params | |
params.permit project: [:title, :summary, :description, :thumbnail, :date, :url, :client_list, :technology_list, :type_list] | |
end | |
end | |
form do |f| |
After finding a lot of other posts on the topic that didn't work out for me this one did the trick so I'm reposting for my own sense of self preservation.
Copy the Virtualbox autostart plist template file to your system's LaunchDaemons folder.
sudo cp \
/Applications/VirtualBox.app/Contents/MacOS/org.virtualbox.vboxautostart.plist \