Skip to content

Instantly share code, notes, and snippets.

Lou Gonzalez hostsamurai

Block or report user

Report or block hostsamurai

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
@hostsamurai
hostsamurai / python_dep_workaround.sh
Created Aug 28, 2013
Prevent NPM modules using node-gyp from freaking out on Arch Linux
View python_dep_workaround.sh
export PYTHON=python2
npm install module-name
@hostsamurai
hostsamurai / app.js
Created Jun 9, 2013
This solves two gotchas I came across when deploying a node site running express through systemd: 1) Remove the callback in `listen` or the requests will hang, and 2) tell systemd what the working directory for your app is.
View app.js
var express = require('express')
, http = require('http')
, path = require('path');
require('systemd');
var app = express();
// configuration and routes go here...
@hostsamurai
hostsamurai / apps.js
Last active Dec 14, 2015 — forked from eliOcs/apps.js
consolidate.js lets you specify partials in your render functions. The gist assumes you have index.html and partial.html inside of your views folder.
View apps.js
/*jslint node: true */
"use strict";
var express = require("express"),
consolidate = require("consolidate"),
Handlebars = require("handlebars"),
fs = require("fs");
var app = express();
@hostsamurai
hostsamurai / canvas.html
Created Jul 1, 2011
Light flickering effect using html5 canvas and JavaScript
View canvas.html
<canvas width=220 height=150></canvas>
@hostsamurai
hostsamurai / configure user
Created Apr 5, 2011
Set up a new user to be a reader
View configure user
Add the user to _users:
$ curl -X POST 'http://admin:admin_pass@127.0.0.1:5984/_users/' -H 'Content-Type: application/json' -d @user.json
@hostsamurai
hostsamurai / gist:851996
Created Mar 2, 2011
Unable to use HTTP proxy handler in CouchDB's externals API
View gist:851996
Apache CouchDB 1.0.2 (LogLevel=debug) is starting.
Configuration Settings ["/etc/couchdb/default.ini","/etc/couchdb/local.ini"]:
[async_mailer] port="9000"
[attachments] compressible_types="text/*, application/javascript, application/json, application/xml"
[attachments] compression_level="8"
[couch_httpd_auth] auth_cache_size="50"
[couch_httpd_auth] authentication_db="_users"
[couch_httpd_auth] authentication_redirect="/_utils/session.html"
[couch_httpd_auth] require_valid_user="false"
[couch_httpd_auth] secret="0c0cd567d2672d625bc8f493c9b2b354"
@hostsamurai
hostsamurai / sinatra_compass_font_face.rb
Created Oct 27, 2010
Get @font-face working again in Sinatra 1.1.0 and Compass 0.10.5
View sinatra_compass_font_face.rb
# Sinatra couldn't load my fonts once I updated to the latest version (1.1.0).
# The solution was to specify the mime types for those fonts.
## mime types for fonts
mime_type '.woff', "application/x-woff"
mime_type '.ttf', "application/x-font-ttf"
mime_type '.eot', "application/vnd.ms-fontobject"
View simple_grid.scss
// Sass (SCSS) version of the Simpler CSS Grid system
// http://www.webdesignerwall.com/tutorials/the-simpler-css-grid/
$grid-width: 978px;
$column-width: 54px;
$column-gutter: 30px;
.grid-col {
float: left;
View html5.vim
" Vim syntax file
" Language: HTML (version 5)
" Maintainer: Rodrigo Machado <rcmachado@gmail.com>
" URL: http://rm.blog.br/vim/syntax/html.vim
" Last Change: 2009 Aug 19
" License: Public domain
" (but let me know if you liked it :) )
"
" Note: This file just adds the new tags from HTML 5
" and don't replace default html.vim syntax file
You can’t perform that action at this time.