Skip to content

Instantly share code, notes, and snippets.

View arlando's full-sized avatar

Arlando Battle arlando

View GitHub Profile
@arlando
arlando / collasped-border.css
Created April 17, 2013 14:54
Table w/ Collasped Border
/*Makes a table with connecting lines*/
.spexTable{
border-collapse: collapse;
border-spacing: 0;
border-color: gray;
}
@arlando
arlando / nginx.conf
Created December 3, 2013 04:19
I was using the Yeoman Marionette Generator to make a site. Node.js serves as an API server, socketIO tool, and serves the index. Nginx handles the static assets. This configuration seems to work okay with the architecture...
#user nobody;
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
@arlando
arlando / pre-push
Created December 3, 2013 18:34
a pre-push hook that calls grunt build when pushing to master for mac osx bash
#!/bin/sh
PATH="/usr/local/bin:/usr/local/share/npm/bin/grunt:$PATH"
echo "Running Pre-Push Hook..."
#check to see if we are on the heavenly master branch
if [ "`git branch | grep \* | cut -f2 -d' '`" == "master" ]
then
echo "Push to master branch ... building dist... pushing to website"
#force repo to build then push the sucka to master
grunt build
@arlando
arlando / mongohq-nginx-proxy
Created December 11, 2013 23:21
Create a reverse proxy pass to your MongoHQ API with this Nginx config.
server {
access_log logs/api.log;
location /api/v1/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://api.mongohq.com/databases/blogv2/collections/posts/documents?_apikey=;
proxy_set_header Host api.mongohq.com;
proxy_connect_timeout 1;
proxy_next_upstream error timeout http_500 http_502 http_503 http_504 http_404;
proxy_intercept_errors on;
@arlando
arlando / kineticjs-note.js
Created January 13, 2014 01:56
KineticJS Notes
//Inheritance Pattern
(function() {
Kinetic.MyCircle = function(config) {
this._initMyCircle(config);
};
Kinetic.MyCircle.prototype = {
_initMyCircle: function(config) {
Kinetic.Circle.call(this, config);
},
@arlando
arlando / progressbar.html
Created February 20, 2014 15:41
Progress Bar - Decided not to use this because it wasn't as smooth. Good example for the HTML5 Progress Bar API though!
<body>
<progress id="energybar" value="10" max="100"></progress>
<script>
/**
* Created by arlando on 2/20/14.
*/
$(function () {
var style = document.createElement("style"),
sheet = document.head.appendChild(style).sheet,
progressbar = $('#energybar'),
@arlando
arlando / Gulpfile.js
Last active August 29, 2015 14:04
Browserify Backbone.Marionette
'use strict';
var gulp = require('gulp');
var browserify = require('browserify');
var concat = require('gulp-concat-sourcemap');
gulp.task('libs', function() {
gulp.src([
'./bower_components/backbone.marionette/lib/core/backbone.marionette.js'
])
@arlando
arlando / attachData
Created October 6, 2014 15:22
attachData.java
@Given("^I perform a query$")
public static void I_perform_query() {
driver.navigate().to("https://qa.1stdibs.com");
driver.manage().timeouts().setScriptTimeout(5, TimeUnit.SECONDS);
Object response = js.executeAsyncScript(
"var callback = arguments[arguments.length - 1];" +
"var xhr = new XMLHttpRequest();" +
"xhr.open('GET', 'https://qa.1stdibs.com/soa/solr/1stdibs/select?q=category_search%3A1&rows=0&wt=json&indent=true&facet=true&facet.field=l3_facets&facet.limit=100000&fq=seller_pk:f_9534', true);" +
"xhr.onreadystatechange = function() {" +
" if (xhr.readyState == 4) {" +
@arlando
arlando / mutext
Created October 8, 2014 15:29
error null
Response Body to [6] PUT
http://oathkeeper.intranet.1stdibs.com:80/soa/inventory/2.1/furniture/item/1310421?sellerToken=f_9883_29c5c7bc57a41ad780076ed21b259fc55d79df968b2cc8d40781894322c8487e&apiToken=dibs_2_wa_p23h255L2oYouE3g95W7dpbXB0h80tD6
{
"httpCode" : 500,
"message" : "null"
}
releasing mutex sellerf_9883
Error: null
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28