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 2.x
$ python -m SimpleHTTPServer 8000
s = """Gur Mra bs Clguba, ol Gvz Crgref | |
Ornhgvshy vf orggre guna htyl. | |
Rkcyvpvg vf orggre guna vzcyvpvg. | |
Fvzcyr vf orggre guna pbzcyrk. | |
Syng vf orggre guna arfgrq. | |
Fcnefr vf orggre guna qrafr. | |
Ernqnovyvgl pbhagf. | |
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. | |
Nygubhtu cenpgvpnyvgl orngf chevgl. |
# fixes "# mesg: ttyname failed: Inappropriate ioctl for device" warnings when building docker | |
# | |
echo '#! /bin/sh' > /usr/bin/mesg | |
chmod 755 /usr/bin/mesg | |
# all this does is replace the 'mesg' command with a no-op that always succeeds. | |
# do this *early* in your Dockerfile somewhere. | |
# from a security persprective this is also fine because it relates to multi-user unix systems, | |
# not single user/contrained docker images. |
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
class A | |
attr_accessor :dsl | |
attr_accessor :state | |
def initialize | |
@state = [] | |
@dsl = self.class.dsl | |
sleep(rand) |
#! /usr/bin/env ruby | |
require_relative '../lib/script.rb' | |
script { | |
help ' | |
HELP! | |
' | |
run { |
// The Vue build version to load with the `import` command | |
// (runtime-only or standalone) has been set in webpack.base.conf with an alias. | |
// | |
import Vue from 'vue' | |
import App from './App' | |
import router from './router' | |
import firebase from 'firebase' | |
Vue.config.productionTip = false |
# | |
require 'open-uri' | |
require 'json' | |
# | |
module TargetSmartStateDictionary | |
def TargetSmartStateDictionary.url | |
@url ||= ( | |
'https://gist.githubusercontent.com/mshafrir/2646763/raw/8b0dbb93521f5d6889502305335104218454c2bf/states_hash.json' | |
) |
module Util | |
def mongo_cluster_command_line_options | |
# | |
Mongoid.default_client # Force the setting to be parsed | |
settings = Map.for(Mongoid.clients[:default]) | |
address = settings[:uri] | |
# | |
unless address && address =~ %r`://` | |
raise("no uri in #{ settings.inspect }") |
# sometimes you need to calculate the rails_root from a subdirectory of a rails' app, eg, lib/capistrano/tasks/db.rake | |
# this code does it properly, but is verbose. golf it! | |
# | |
rails_root = File.expand_path(Dir.pwd) | |
until rails_root == '/' | |
if %w[ Gemfile app public ].all?{|entry| test(?e, "#{ rails_root }/#{ entry }")} | |
break | |
else | |
rails_root = File.dirname(rails_root) |