For Mac and Windows users, just install Docker Toolbox. It provides what you need to get started, including:
export PYENV_ROOT="${HOME}/cache/.pyenv" | |
if [ -d ${PYENV_ROOT} ]; then (cd ${PYENV_ROOT}; git pull --rebase); else git clone https://github.com/yyuu/pyenv.git ${PYENV_ROOT}; fi | |
export PATH="${PYENV_ROOT}/bin:${PATH}" | |
eval "$(pyenv init -)" | |
pyenv install -s; echo 'lofasz' | |
pip install --upgrade pip setuptools | |
[ -f requirements.txt ] && pip install -r requirements.txt | |
[ -f requirements.development.txt ] && pip install -r requirements.development.txt |
It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time
class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime
steps in:
>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |
#####Copied from askubuntu's Enabling mic mute button and light on Lenovo Thinkpad
There are two possible "hardware" indicators (to show that mute is on or off):
The Power button light (green) will blink to show when mute is on The Mic mute button light (orange) will be on or off to show mute status (just like in Windows)
Solution 2 requires a patched thinkpad_acpi
kernel module, and is only recommended for advanced users who know what they are doing. This is because the patch is not included by the thinkpad_acpi
developers by default, (See this discussion for more details).
###Common Steps
namespace :db do | |
desc 'Drop all database connections' | |
task :drop_connections => :environment do | |
database = Rails::Application.config.database_configuration[RAILS_ENV]["database"] | |
field = if ActiveRecord::Base.connection.send( :postgresql_version ) < 90200 | |
'pg_stat_activity.procpic' # PostgreSQL <= 9.1.x | |
else | |
'pg_stat_activity.pid' # PostgreSQL >= 9.2.x | |
end |
#!/usr/bin/env bash | |
mkdir vim | |
curl https://s3.amazonaws.com/heroku-vim/vim-7.3.tar.gz --location --silent | tar xz -C vim | |
export PATH=$PATH:/app/vim/bin |
module Tire | |
module Disable | |
module ClassMethods | |
def mock_es_response_doc | |
@mock_es_response_doc ||= | |
'{"took": 1,"timed_out": false,"_shards": {"total": 5,"successful": 5,"failed": 0},"hits": {"total": 0,"max_score": null,"hits": []}}' | |
end | |
def enable! &blk | |
old_enabled = @tire_enabled || false |
require 'openssl' | |
require 'digest/sha1' | |
require 'net/https' | |
require 'base64' | |
class CloudFrontInvalidator | |
#file - The Paperclip attachment | |
#style - The defined style to invalidate (e.g. :original, :thumbnail...) | |
def initialize(file, style = :original) | |
@aws_account = aws_access_key_id |