Skip to content

Instantly share code, notes, and snippets.

View dekz's full-sized avatar
🐢
⠚⠁⠉⠕⠃

Jacob Evans dekz

🐢
⠚⠁⠉⠕⠃
View GitHub Profile
@dekz
dekz / aws-logs-tail-group.sh
Created November 14, 2016 11:48 — forked from tekwiz/aws-logs-tail-group.sh
AWS Logs Tailer
#!/bin/bash
group_name='<log-group-name>'
start_seconds_ago=3600
aws_cmd_opts= # e.g. "--profile <profile-name>"
# Usage: get_loglines "<log-group-name>" <start-time>
get_loglines() {
aws $aws_cmd_opts --output text logs filter-log-events \
--log-group-name "$1" \
@dekz
dekz / iTerm2Build.sh
Created April 20, 2016 12:29
Custom iTerm2 Build Script
#!/bin/bash
# Original idea from here: http://superuser.com/questions/810582/iterm-osx-terminal-change-text-margin-from-edge-of-window
# Download, unzip, clean up.
wget --quiet https://github.com/gnachman/iTerm2/archive/master.zip
unzip master.zip
rm master.zip
# Go into project directory.
#!/bin/sh
echo "-----BEGIN CERTIFICATE-----
MIIDCDCCAnGgAwIBAgIJAL/rbFkj0BMCMA0GCSqGSIb3DQEBCwUAMIGcMQswCQYD
VQQGEwJBVTERMA8GA1UECAwIVmljdG9yaWExEjAQBgNVBAcMCU1lbGJvdXJuZTEX
MBUGA1UECgwOSG9vcm9vIFB0eSBMdGQxITAfBgNVBAsMGEhvb3JvbyBTZWN1cml0
eSAoSG9vU2VjKTEqMCgGA1UEAwwhSG9vcm9vIFByaW1hcnkgUm9vdCBDQSAtIElu
dGVybmFsMB4XDTE0MTIwMjAxMzQyMVoXDTI0MTEyOTAxMzQyMVowgZwxCzAJBgNV
BAYTAkFVMREwDwYDVQQIDAhWaWN0b3JpYTESMBAGA1UEBwwJTWVsYm91cm5lMRcw
FQYDVQQKDA5Ib29yb28gUHR5IEx0ZDEhMB8GA1UECwwYSG9vcm9vIFNlY3VyaXR5
@dekz
dekz / choose.vim
Last active August 29, 2015 14:13
" find file in git repo
function! ChooseFile()
let dir = expand("%:h")
if empty(dir) | let dir = getcwd() | endif
let root = system("cd " . dir . " && git rev-parse --show-toplevel")
if v:shell_error != 0 | echo "Not in a git repo" | return | endif
let root = root[0:-2]
let selection = system("cd " . root . " && git ls-files -co --exclude-standard | choose")
@dekz
dekz / introrx.md
Last active August 29, 2015 14:09 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

#!/bin/bash
#
# Publishes CloudWatch metrics about Buildbox queue length
set -e
API='https://api.buildbox.io'
BUILDS_ROUTE='v1/accounts/ACCOUNT_NAME/projects/PROJECT_NAME/builds'
# Determines whether a binary exists on the current $PATH
@dekz
dekz / README.md
Created November 13, 2013 23:37 — forked from JoelBesada/README.md

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@dekz
dekz / jruby-1.6.7 1.8
Created June 5, 2012 23:20 — forked from kouno/gist:2878246
Inheritance of BigDecimal breaks is_a? function in JRuby
~/tmp % jruby -v
jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_31) [darwin-x86_64-java]
~/tmp % jruby zz.rb
Decimal.new is a Decimal object?: false
SubString.new is a SubString object?: true
@dekz
dekz / ichat-growl.scpt
Created February 18, 2012 02:14 — forked from markkendall/ichat-growl.scpt
iChat / Messages integration for Growl 1.3
-- growl notifications for iChat, based on
-- http://scriptingosx.com/2010/11/ichat-notification-with-growl/
property growlAppName : "Growl iChat"
property notificationNames : {"Buddy Became Available", ¬
"Buddy Became Unavailable", ¬
"Message Received", ¬
"Completed File Transfer"}
property defaultNotificationNames : {"Buddy Became Available", ¬