See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
Abolishing Pedestrian Posturing | |
Abstracting Loading Procedures | |
Activating Deviance Threshold | |
Activating Hotel Staff | |
Activating Story Arc | |
Adapting Behavioral Model | |
Adding Hidden Agendas | |
Adjusting Acceptable Apparel | |
Adjusting Bell Curves | |
Adjusting Emotional Weights |
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
const asyncForEach = async (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
const start = async () => { | |
await asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
end | |
puts cmd |
#!/bin/bash | |
# Sometimes you need to move your existing git repository | |
# to a new remote repository (/new remote origin). | |
# Here are a simple and quick steps that does exactly this. | |
# | |
# Let's assume we call "old repo" the repository you wish | |
# to move, and "new repo" the one you wish to move to. | |
# | |
### Step 1. Make sure you have a local copy of all "old repo" | |
### branches and tags. |
<?php | |
/* | |
* Plugin Name: Root-based Category URLs | |
* Description: Enables root-based Category URLs, i.e. Makes /category/my-category/ URLs route as /my-category/ | |
* Author: Mike Schinkel | |
* Author URI: http://about.me/mikeschinkel | |
* Plugin URI: https://gist.github.com/1421235 | |
* Version: 0.1.1 | |
* License: GPL 2+ | |
*/ |
## just some ways to check if a url exists | |
# method 1 - from Simone Carletti | |
require "net/http" | |
url = URI.parse("http://www.google.com/") | |
req = Net::HTTP.new(url.host, url.port) | |
res = req.request_head(url.path) | |
# method 2 - from some kid on the internet | |
require 'open-uri' |