Skip to content

Instantly share code, notes, and snippets.

View brock's full-sized avatar
😎

Brock Angelo brock

😎
View GitHub Profile
@brock
brock / README.md
Created August 9, 2013 01:08 — forked from mbbx6spp/README.md

Distributed or Dancer Shell

Similar to ansible command but allows you to use any command that will work in your shell. Not tied to specific configuration management tooling, just SSH and your default shell on remote systems. Just works. I <3 it :)

What does it do?

Runs commands across potentially many machines. Allows you to organize your servers/VMs/instances into groups very easily.

Getting Started

@brock
brock / open-starred-urls.sh
Last active December 21, 2015 15:59
Two files: an applescript that runs a bash script when items are added to a folder. http://wp.me/p2mniA-3Q
#!/bin/bash
# copy this to ~/bin: cp open-starred-urls.sh ~/bin
# make executable: chmod +x ~/bin/open-starred-urls.sh
# http://wp.me/p2mniA-3Q
cd ~/Dropbox/IFTTT/Desktop
for file in *.txt; do
cat $file | xargs open
mv $file archive
done
@brock
brock / README.md
Last active December 24, 2015 01:29
boom gui.

Boom GUI

An AngularJS view of your items stored in boom.

Now with Lazy-Loading of images, thanks to Filip.

This assumes everything you store in boom is an image. One of these days I'll submit a proper pull-request to the boom repo, but not today.

  1. Copy boom.html to your home directory.
  2. Copy the contents of function.sh into your dotfiles, or move to your ~/bin as ~/bin/boomgui and make executable (chmod +x ~/bin/boomgui).
  3. Run boomgui from the command line.
@brock
brock / boom.html
Created September 28, 2013 21:37
Lazy Load images for Boom GUI. Asked on StackOverflow, solution here: https://gist.github.com/brock/6724161
<!DOCTYPE HTML>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" charset="utf-8"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.min.js"></script>
<script src="//cdn.jsdelivr.net/jquery.lazyload/1.9.0/jquery.lazyload.min.js"></script>
<script type="text/javascript">
angular.module('boomApp', [])
.controller('BoomCtrl', function ($scope, $http) {
$http.get(".boom")
@brock
brock / 0_reuse_code.js
Created October 29, 2013 19:07
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
import praw # simple interface to the reddit API, also handles rate limiting of requests
import re
from collections import deque
from time import sleep
USERNAME = "Your username here"
PASSWORD = "Your password here"
USERAGENT = "Your useragent string here. It should include your /u/username as a courtesy to reddit"
r = praw.Reddit(USERAGENT)

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].

@brock
brock / webinar.md
Last active August 29, 2015 14:00
a crazy good webinar on using webstorm. these are notes to accompany the recorded session that will be published the week of Mon, April 28th

WebStorm AngularJS Webinar

AngularJS

  1. Install angular with: terminal: bower install angular
  2. Ctrl-space twice
  3. ng stuff works now
  4. Preferences: Editor: angularjs add whitespace
  5. Debug (there is a shortcut so you can do live edit and it updates in chrome)
  6. You can change your code style for html. Preferences: Code Style: HTML (worth a look through these settings)
  7. Cmd+Alt+L to reformat your code
L.Control.Button = L.Control.extend({
options: {
position: 'bottomleft'
},
initialize: function (options) {
this._button = {};
this.setButton(options);
},
@brock
brock / gs.sh
Last active August 29, 2015 14:01
Name git stashes
function gs() {
BRANCH=$(git branch | grep "*" | sed 's/^\* //')
TODAY=$(date +"%Y%m%d-%H%M%S")
git stash save $TODAY-$BRANCH
}