Skip to content

Instantly share code, notes, and snippets.

View jchamberlain's full-sized avatar

Joshua Chamberlain jchamberlain

View GitHub Profile
@jchamberlain
jchamberlain / run.sh
Created January 5, 2017 21:53
Create CSV from psql output
# Assuming results.txt is the output of using the \o options in psql, convert to a csv.
tail -n +3 results.txt | head -n -2 | sed -r 's/ //g' | sed 's/|/,/g' > results.csv
@jchamberlain
jchamberlain / Insert.php
Last active August 29, 2015 14:02
Check Insert Times in Laravel 4
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class Insert extends Command {
/**
* The console command name.
@jchamberlain
jchamberlain / app.js
Last active August 29, 2015 13:58
Reproduce Empty Object in Restangular.addElementTransformer()
var app = angular.module('app', ['restangular'])
app.controller('MainCtrl', function($scope, Restangular) {
var Widget = Restangular.all('response.json');
$scope.widgets = [];
// add transformer
Restangular.addElementTransformer('response.json', false, function(widget) {
widget.addRestangularMethod('doSomething', 'post');
return widget;