In psql, define the function:
CREATE OR REPLACE FUNCTION db_to_csv(path TEXT) RETURNS void AS $$
declare
tables RECORD;
statement TEXT;
begin
FOR tables IN
SELECT (table_schema || '.' || table_name) AS schema_table
In psql, define the function:
CREATE OR REPLACE FUNCTION db_to_csv(path TEXT) RETURNS void AS $$
declare
tables RECORD;
statement TEXT;
begin
FOR tables IN
SELECT (table_schema || '.' || table_name) AS schema_table
StringLiterals: | |
EnforcedStyle: double_quotes | |
LineLength: | |
Max: 80 | |
# When using conditionals in assignment, the `end` should align with the | |
# beginning of the variable, not the `if` | |
EndAlignment: | |
AlignWith: variable |
# hubot-scripts test | |
# usage: | |
# hubot cmd ls -la | |
# | |
fs = require('fs') | |
spawn = require('child_process').spawn | |
module.exports = (robot) -> | |
robot.respond /(cmd) (.*) (.*)/i, (msg) -> | |
cmd = msg.match[2] | |
arg = msg.match[3] |
#!/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" |
require 'rubygems' | |
require 'google_drive' | |
# set your username and password | |
login = GoogleDrive.login(GoogleDrive::USERNAME, GoogleDrive::PASSWORD) | |
# set your spreadsheet key | |
sheet = login.spreadsheet_by_key(GoogleDrive::SPREADSHEET) | |
sheet.worksheets.each do |ws| | |
p ws.title |
This is a dump of links to checkout for later.
import re | |
import sys | |
import os | |
from stat import * | |
import subprocess | |
import shlex | |
import hashlib | |
import time | |
import datetime | |
import pymongo |
$ffmpeg -i <input file> -threads <max threads> -vf "transpose=1" -s 1280x720 -r <frame rate> -sameq <output file> |
sudo usermod -a -G www-data <some_user> | |
sudo chgrp -R www-data /var/www | |
sudo chmod -R g+w /var/www | |
sudo find /var/www -type d -exec chmod 2775 {} \; | |
sudo find /var/www -type f -exec chmod ug+rw {} \; |