Skip to content

Instantly share code, notes, and snippets.

🐦
makin my way downtown, walkin fast, faces pass and I'm homebound

Tim Anema tanema

🐦
makin my way downtown, walkin fast, faces pass and I'm homebound
Block or report user

Report or block tanema

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am tanema on github.
  • I am timanema (https://keybase.io/timanema) on keybase.
  • I have a public key ASB-TL0sgWCQjhi74q_peFJTNo2FDEgs3llgDLu6uQr1VAo

To claim this, I am signing this object:

View irchelp1.rb
require 'csv'
puts "[unifi.rb] Grabbing data from UniFi Controller"
result = <<-eos
NAME MAC AP CHAN RSSI RX TX
GARETH-LAPTOP 9c:2a:70:c9:c3:37 SR_Wifi 1 44 72 72
android-ac059065c685d5be 90:18:7c:2f:bd:40 SR_Wifi 1 33 1 72
Joes-iPhone a8:88:08:66:7e:ed SR_Wifi 1 32 24 72
sr-dash-01 90:4c:e5:b3:3a:69 SR_Wifi 1 28 52 58
android-1be24885e86c9fb1 80:57:19:03:08:5f SR_Wifi 1 21 6 52
@tanema
tanema / rails_and_proxy.sh
Created Dec 12, 2014
Rails and haproxy in one script for our front end guy
View rails_and_proxy.sh
#! /bin/bash
# used for kill signals
kill_rails () {
kill -6 ${rails_pid} > /dev/null 2>&1
}
#get password for haproxy
read -s -p "Enter Password: " proxy_pass
echo ""
@tanema
tanema / multiprocess_migration.sh
Last active Jun 29, 2018
migrate files from gridfs to aws s3
View multiprocess_migration.sh
#! /bin/bash
###################### USAGE ######################################
usage() {
echo "
Usage: mongotos3 [-t n] mongo_host mongo_collection s3_bucket
-t : number of parallel processes to use
mongo_host : the host of the mongodb server
mongo_collection : the collection to collecthe gridfs data from
s3_bucket : the name of the bucket you want to cp the files to
"
@tanema
tanema / chat-client.go
Created Oct 3, 2013
distributed chat client made for a golang hack night, it can both send and receive messages
View chat-client.go
package main
import (
"fmt"
"flag"
"net"
"bufio"
"os"
"time"
"strconv"
@tanema
tanema / git-type-loc.sh
Created May 27, 2013
Get the number of lines of code by extension, on a git repo.
View git-type-loc.sh
git ls-files | perl -pe "s/.*\.(.*?)\n/\.\1\n/" | awk '/\..*/' | sort | uniq | xargs -n1 -E '\n' -I % sh -c 'git ls-files "*%" | xargs cat | echo "$(wc -l) %"' | sort -rn
@tanema
tanema / gist:3445133
Created Aug 24, 2012
Ember trigerable text field so when enter button is pressed an action is called
View gist:3445133
ABApp.TriggerableTextField = Ember.TextField.extend(Ember.TargetActionSupport, {
insertNewline: function() {
this.triggerAction();
}
});
@tanema
tanema / vimrc
Created Aug 21, 2012
my vimrc file
View vimrc
set nocompatible " use vim defaults
set mouse=a " use mouse because I am a noob
set ls=2 " allways show status line
set tabstop=2 " numbers of spaces of tab character
set shiftwidth=2 " numbers of spaces to (auto)indent
set scrolloff=3 " keep 3 lines when scrolling
set showcmd " display incomplete commands
set hlsearch " highlight searches
set incsearch " do incremental searching
set ruler " show the cursor position all the time
@tanema
tanema / gist:3415843
Created Aug 21, 2012
my windows prompt
View gist:3415843
make a env variable called prompt and enter this
tim@$T$S$P$_$$$S
@tanema
tanema / cookielistener.js
Created Aug 21, 2012
cookie listener for changes
View cookielistener.js
function cookieListener(cookieName, callback) {
this.cookiename = cookieName;
this.callback = callback;
this.cookieRegistry = [];
this.interval = setInterval(this.observe, 100);
}
cookieListener.prototype.CREATED = 'created';
cookieListener.prototype.DELETED = 'deleted';
cookieListener.prototype.UPDATED = 'updated';
cookieListener.prototype.observe = function() {
You can’t perform that action at this time.