Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -eu
set -o pipefail
# check mandatory variables
[[ -n $BKP_APP_NAME ]]
[[ -n $BKP_AWS_ACCESS_KEY_ID ]]
[[ -n $BKP_AWS_SECRET_ACCESS_KEY ]]
[[ -n $BKP_AWS_S3_BUCKET ]]
[[ -n $BKP_AWS_S3_BUCKET_PATH ]]
[[ -n $BKP_AWS_S3_KMS_KEY_ID ]]

Keybase proof

I hereby claim:

  • I am karimbutt on github.
  • I am karimbutt (https://keybase.io/karimbutt) on keybase.
  • I have a public key ASBSUQGEFFmrc6SBJro7wSMBn_Rt15H2uc2cXMIt3q9G4go

To claim this, I am signing this object:

@karimbutt
karimbutt / Rails & Angular Websockets Channel Binding
Created March 29, 2015 01:12
Shows how to send a message to a channel on your Angular frontend from anywhere in your Rails app
// ANGULAR: Listen/bind to a channel on the angular side in the Angular controller
$scope.dispatcher = new WebSocketRails(ROUTE_IN_RAILS_FOR_WS);
var channel = $scope.dispatcher.subscribe('motion_detector');
channel.bind('status', function(response) {
$scope.motionDetectorStatus = response.status
});
@karimbutt
karimbutt / histogram_output
Created November 20, 2014 18:55
Color Histogram output
[1] pry(main)> histogram
=> #<Histogram:0x007fa6b322c1b0
@lines=
["64756: ( 95,125, 61, 0) #5F7D3D00 srgba(95,125,61,0)",
"1933: ( 7, 29, 3,255) #071D03 srgba(7,29,3,1)",
"1876: ( 11, 42, 3,255) #0B2A03 srgba(11,42,3,1)",
"1520: ( 18, 65, 5,255) #124105 srgba(18,65,5,1)",
"1406: ( 16, 50, 5,255) #103205 srgba(16,50,5,1)",
"1262: ( 22, 77, 5,255) #164D05 srgba(22,77,5,1)",
"1248: (133,179, 92, 69) #85B35C45 srgba(133,179,92,0.270588)",