Skip to content

Instantly share code, notes, and snippets.

View sethbergman's full-sized avatar
🐋
Building Docker Images for Dell Technologies

Seth Bergman sethbergman

🐋
Building Docker Images for Dell Technologies
View GitHub Profile
@sethbergman
sethbergman / reporter_to_airtable.rb
Created March 16, 2017 09:55 — forked from craigeley/reporter_to_airtable.rb
An example of moving Reporter entries to Airtable in near-real time using Reporter's JSON output and the Airtable API.
#!/usr/bin/env ruby
# Scipt Example for Moving Reporter Entries to Airtable Rows in near-real time
require 'time'
require 'json'
# To prevent encoding errors on OSX
if RUBY_VERSION =~ /2.*.*/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
export function getTodos() {
return {
type: API_REQUEST,
payload: {
url: "http://api.com/todos",
method: "GET",
onError: GET_TODOS_ERROR,
onSuccess: GET_TODOS_SUCCESS
}
}
class TodosService {
constructor(private @Inject(API_CONFIG) api, private http: Http) {}
getTodos() {
return http.get(this.api.todos);
}
}
@sethbergman
sethbergman / postgresql-debugger-install-ubuntu
Created February 15, 2017 09:58 — forked from jhngrant/postgresql-debugger-install-ubuntu
Installing the PL/pgSQL Debugger Extension (pldbgapi) for pgAdmin III on PostgreSQL 9.4 and Ubuntu 14.10
# PostgreSQL can be on a remote server but you'll need root privileges in Linux and superuser in PostgreSQL.
# First install build tools
sudo su
aptitude install build-essential
aptitude install postgresql-server-dev-9.4
# Clone and build the PL/pgSQL server-side debugger
@sethbergman
sethbergman / README.md
Created February 9, 2017 02:42 — forked from cjolly/README.md
How to securely set rails secret key when you deploy to Heroku.

Stop Versioning Rails Secret Tokens

After reading Code Climate's Rails' Insecure Defaults I realized I was guilty of breaking rule 3. Versioned Secret Tokens. Here's how I fixed it.

Use dotenv in development and test environments:

# Gemfile
gem 'dotenv-rails', groups: [:development, :test]
@sethbergman
sethbergman / node-and-npm-in-30-seconds.sh
Created January 28, 2017 06:34 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@sethbergman
sethbergman / helium-desktop.sh
Created January 24, 2017 13:05 — forked from olesenm/helium-desktop.sh
helium shell script with normal system locations for 'adb'
#!/bin/sh
# start helium server on android device - see http://www.clockworkmod.com/carbon for more details
# set -x
# try normal system locations before the local binary
unset adb
for i in /usr/bin /usr/local/bin "$(/usr/bin/dirname $0)"
do
i="$i/adb"
if [ -f "$i" -a -x "$i" ]
@sethbergman
sethbergman / Makefile
Created June 23, 2016 07:35 — forked from llj098/Makefile
a sample tcp server runs in kernel
obj-m += tcp_svr_sample.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea
@sethbergman
sethbergman / parser.js
Created March 25, 2016 23:38 — forked from ben-ng/parser.js
Heroku DB URL parser
function parse_url(str, component) {
// http://kevin.vanzonneveld.net
// + original by: Steven Levithan (http://blog.stevenlevithan.com)
// + reimplemented by: Brett Zamir (http://brett-zamir.me)
// + input by: Lorenzo Pisani
// + input by: Tony
// + improved by: Brett Zamir (http://brett-zamir.me)
// + improved by: Ben Ng (http://benng.me)
// % note: Based on http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js
// % note: blog post at http://blog.stevenlevithan.com/archives/parseuri
@sethbergman
sethbergman / Procfile
Created March 15, 2016 02:59 — forked from jkresner/Procfile
Deploy brunch to heroku
web: ./node_modules/.bin/coffee app.coffee