Skip to content

Instantly share code, notes, and snippets.

Postgres.app/Contents/MacOS/share/man/man1:
cjpeg.1 cs2cs.1 ecpg.1 pg_archivecleanup.1 pg_dump.1 pg_standby.1 postgres.1 reindexdb.1
clusterdb.1 djpeg.1 geod.1 pg_basebackup.1 pg_dumpall.1 pg_test_fsync.1 postmaster.1 vacuumdb.1
createdb.1 dropdb.1 initdb.1 pg_config.1 pg_receivexlog.1 pg_test_timing.1 proj.1 vacuumlo.1
createlang.1 droplang.1 jpegtran.1 pg_controldata.1 pg_resetxlog.1 pg_upgrade.1 psql.1 wrjpgcom.1
createuser.1 dropuser.1 oid2name.1 pg_ctl.1 pg_restore.1 pgbench.1 rdjpgcom.1
Postgres93.app/Contents/MacOS/share/man/man1:
bmp2tiff.1 fax2ps.1 jpegtran.1 ras2tiff.1 sgi2tiff.1 tiff2ps.1 tiffcrop.1 tiffinfo.1 tiffsv.1
cjpeg.1 fax2tiff.1 pal2
@vitaly
vitaly / x
Last active August 29, 2016 12:25
Run the command in x tmux splits. e.g. `bash x 4 iex` will run `iex` in 4 spilts in tmux
#!/bin/bash -x
N=$1; shift
if [ -z "$N" -o -z "$1" ]; then
cat <<_
Usage: $0 N COMMAND
_
exit 1
fi
def self.postprocess(id)
Measurement.find(id).postprocess!
end
def postprocess!
process_start!
ImagesPostProcess.inspector_post_process("/demo/measurements/#{id}")
process_end!
end
#!/usr/bin/env ruby
require 'base64'
require 'openssl'
require 'digest/sha1'
def ask(prompt)
STDOUT.print "#{prompt}: "
readline.strip
end
safe do
local :path => "backup1"
tar do
archive "a1", :files => "some-directory-to-backup"
end
end
safe do
safe do
local :path => "backup/:kind"
tar do
archive "a1", :files => "some-directory-to-backup"
end
end
require "fileutils"
class C
def initialize(x)
@x = x
end
def each(&block)
@x.times(&block)
end
include Enumerable
# Lets say you have f1, f2, f3 - functions provided by some API that you can't change
# and they use the standard (err, res...) callback scheme
# then suppose you need to call 3 of them one after the other
# the usual js way will be this:
foo = (params, callback) ->
f1 something, (err, res) ->
if err
callback err
else
f2 something, (err, res) ->
module Devise
module Models
# Validatable creates all needed validations for a user email and password.
# It's optional, given you may want to create the validations by yourself.
# Automatically validate if the email is present, unique and it's format is
# valid. Also tests presence of password, confirmation and length
module Validatable
# All validations used by this module.
VALIDATIONS = [ :validates_presence_of, :validates_uniqueness_of, :validates_format_of,
✗ which bundle
bundle () {
if (
unset bundle
command -v bundle > /dev/null 2>&1
)
then
true
else
if (