Skip to content

Instantly share code, notes, and snippets.

View cjs's full-sized avatar

Craig Steinberger cjs

View GitHub Profile
@cjs
cjs / sample_gas_enterprise.gs
Created April 12, 2017 21:39
A sample Google Apps Script
/**
* Authorizes and makes a request to the GitHub API.
*/
function run() {
var service = getService();
if (service.hasAccess()) {
var url = 'https://cjs.sickbaylab.com/api/v3/user';
var response = UrlFetchApp.fetch(url, {
headers: {
Authorization: 'Bearer ' + service.getAccessToken()
@cjs
cjs / httpie-completion.fish
Created February 7, 2017 21:25
Httpie fish completions, for install with fisherman
# copied from https://github.com/jkbrzt/httpie/blob/master/extras/httpie-completion.fish for fisherman install
function __fish_httpie_auth_types
echo "basic"\t"Basic HTTP auth"
echo "digest"\t"Digest HTTP auth"
end
function __fish_httpie_styles
echo "autumn"
echo "borland"
@cjs
cjs / 0-readme.md
Last active August 29, 2015 14:19 — forked from burke/0-readme.md

Boxen uses a bunch of shellscripts to insert itself into your environment on shell load.

These assume a POSIX shell, which fish is not.

Run this script to generate a fish-compatible config file in ~/.config/fish/boxen.fish, which you can source at the end of your ~/.config/fish/config.fish.

@cjs
cjs / sql_regexp_samples.sql
Last active August 29, 2015 14:11
Useful Oracle SQL Regexp Snippets
--Split a string on :
-- Second Element:
select regexp_substr('First String: Second String', '[^:]+', 1, 2)
from dual;
-- Valid IP address
select 1 from dual
where regexp_like('192.168.2.254', '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$');'
@cjs
cjs / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cjs
cjs / build-bash-etch.sh
Last active August 29, 2015 14:06
Build bash from source for Debian etch distributions
# I didn't write this, I just adapted it from the lenny version: https://gist.github.com/href/54859127c183f67f947f
# inspired by http://askubuntu.com/a/528171
# prerequisites
sudo apt-get install bison
# get bash 3.1 source
mkdir src && cd src
wget http://ftp.gnu.org/gnu/bash/bash-3.1.tar.gz
tar zxvf bash-3.1.tar.gz
@cjs
cjs / iotestfailures.md
Last active August 29, 2015 14:02
Io Test Failures

Io language test failures on Debian Stable:

root@97111b64e45f:/tmp/iobuild/io-2013.12.04/build# io ../libs/iovm/tests/correctness/run.io
..........EE.......................................................E..
......................................................................
......................................................................
...................
======================================================================
FAIL: DirectoryTest testWalk
@cjs
cjs / keybase.md
Created February 28, 2014 13:03
keybase.io verificiation

Keybase proof

I hereby claim:

  • I am cjs on github.
  • I am cjs (https://keybase.io/cjs) on keybase.
  • I have a public key whose fingerprint is B6CF 6990 889F 641B DA8C 0C5E C970 85CF E5BA 0ED3

To claim this, I am signing this object: