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
const app = Application.currentApplication() | |
app.includeStandardAdditions = true | |
function getJSON(path) { | |
const fullPath = path.replace(/^~/, app.pathTo('home folder')) | |
const contents = app.read(fullPath) | |
return JSON.parse(contents) | |
} | |
function run() { |
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
echo "Creating an SSH key for you..." | |
ssh-keygen -t rsa | |
echo "Please add this public key to Github \n" | |
echo "https://github.com/account/ssh \n" | |
read -p "Press [Enter] key after this..." | |
echo "Installing xcode-stuff" | |
xcode-select --install |
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
# encoding: utf-8 | |
require "timeout" | |
# Capture the standard output and the standard error of a command. | |
# Almost same as Open3.capture3 method except for timeout handling and return value. | |
# See Open3.capture3. | |
# | |
# result = capture3_with_timeout([env,] cmd... [, opts]) | |
# |
# Edit and rename this file and then place it in /etc/wyzecam-to-rtmp | |
WYZE_EMAIL="joeblow@example.com" | |
WYZE_PASSWORD="wyzepasshere" | |
WYZE_CAMERA_NAME="Doorbell" | |
RTMP_URL="rtmp://127.0.0.1/live/doorbell" |
if (-f $document_root/system/maintenance.html) { | |
return 503; | |
} | |
error_page 503 @maintenance; | |
location @maintenance { | |
internal; | |
if ($http_accept ~ json) { | |
return 503 "{}"; | |
} |
// Require the REPL module | |
// and models | |
let repl = require('repl').start({}); | |
const models = require('./models'); | |
// Make the `models` object | |
// a global variable in the | |
// REPL | |
repl.context.models = models; |
[aaron@TC omglolwut (master)]$ cat lib/tasks/disable_autoload_during_migrations.rake | |
task :disable_autoload do | |
ActiveSupport::Dependencies.class_eval do | |
extend Module.new { | |
def load_file(path, const_paths = loadable_constants_for_path(path)) | |
return if path.starts_with? File.join(Rails.application.root, 'app', 'models') | |
super | |
end | |
} | |
end |
#!/usr/bin/env ruby | |
require 'csv' | |
# This assumes: | |
# - Ruby 1.9's CSV library, if you are using 1.8, use FasterCSV. | |
# | |
# https://raw.github.com/hadley/data-baby-names/master/baby-names.csv | |
csv_fname = "baby-names.csv" |