Skip to content

Instantly share code, notes, and snippets.

View evantahler's full-sized avatar
💭
Programmin'

Evan Tahler evantahler

💭
Programmin'
View GitHub Profile
@evantahler
evantahler / config.js
Last active August 29, 2015 13:57
an action to send files
// ...
config.servers.web.rootEndpointType = 'api'
// ...
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>
<div id="container"></div>
<script type="text/javascript">
var doRequest = function(action){
$.get('/api/' + action, function(data){
@evantahler
evantahler / webSocketLoadTest.html
Created June 16, 2014 05:42
A websocket load test for actionhero
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="en" />
<meta name="description" content="actionhero.js" />
<title>actionhero.js WebSocket Load Test</title>
<style>
.green {background-color: green;}
.red {background-color: red;}
### Keybase proof
I hereby claim:
* I am evantahler on github.
* I am evantahler (https://keybase.io/evantahler) on keybase.
* I have a public key whose fingerprint is 8132 187A 483C CB1C D6D4 A5DF ED85 B288 15AC F3BE
To claim this, I am signing this object:
@evantahler
evantahler / aaa.bash
Last active August 29, 2015 14:13
Can't log into NPM
> uname -a (osx yosemite)
Darwin Opsimus.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
> node --version
v0.10.35
> npm --version
2.1.18
> npm login
@evantahler
evantahler / production.rb
Last active August 29, 2015 14:14
If you want ansible tower to source an inventory file checked into a project, here's an example of how to do it.
#!/usr/bin/env ruby
require 'json'
inventory_file = 'production'
# Configure inputs
# assumes a project layout with ./inventories/{{ inventory_file }}
if File.exists? '/var/lib/awx/projects/'
folder = Dir.glob('/var/lib/awx/projects/*').max { |a,b| File.ctime(a) <=> File.ctime(b) }
@evantahler
evantahler / spec_helper.rb
Created July 13, 2015 21:36
Testing Ansibile with Vagrant and RSpec
require 'net/ssh'
require "#{File.dirname(__FILE__)}/utils/gems.rb"
require "#{File.dirname(__FILE__)}/utils/multi_logger.rb"
require "#{File.dirname(__FILE__)}/utils/subprocess.rb"
class SpecHelper
class << self
@@booted = false
@evantahler
evantahler / coloring_in_the_terminal
Created March 23, 2011 00:34
A note on how to color stuff in the shell
echo $'\033[31mChoose one of the following persons:\033[0m SOMETHNG ELSE'
def color(text, color_code)
color_enabled? ? "#{color_code}#{text}\e[0m" : text
end
def bold(text)
color(text, "\e[1m")
end
@evantahler
evantahler / gist:980212
Created May 19, 2011 04:54
Chrome console.log note
///////////////
// Chrome Console wackyness
// It seems that objects that can be rendered to "Strings" (strings and numbers) will render with console.log
// However, obects that are "interpreted" graphically will be shown in the state they are at the conclusion of runtime (or whatever their state is when being viewed).
// Example:
var TestObject = new Object;
TestObject.name = "name 1";
console.log(TestObject) // will show the name attribue as "name 2" when viewed in chrome
console.log(TestObject.name) // will show "name 1" as expected
@evantahler
evantahler / mime.js
Created December 25, 2011 03:13
mime type lookup for javascript
var determineMimeType = function(fileName){
var mimeTypes = {
'.3dm': 'x-world/x-3dmf'
,'.3dmf': 'x-world/x-3dmf'
,'.a': 'application/octet-stream'
,'.aab': 'application/x-authorware-bin'
,'.aam': 'application/x-authorware-map'
,'.aas': 'application/x-authorware-seg'
,'.abc': 'text/vnd.abc'
,'.acgi': 'text/html'