Skip to content

Instantly share code, notes, and snippets.

View gist:5528978
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
# Define cached location (may not be whole site)
View gist:5828689
* @file
* Begin the process of additing additonal user utilities.
* Implementation of hook_drush_command().
View jquery.bootstrap.confirm.popover.js
Copyright (c) 2011 Damien Antipa,,
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
View index.html
<!DOCTYPE html>
<script type="text/javascript" src=""></script>
<title>Drag And Drop</title>
<div id="viz"></div>
rom3r4 / gist:7149525
Created October 25, 2013 04:43
newVOA3R. NGINX config for a Drupal 7 Site
View gist:7149525
server {
listen *:80;
server_name ___ENTER_YOUR_SITE_URL_HERE___;
index index.php;
access_log off;
rom3r4 / gist:7540201
Created November 19, 2013 04:10
Using handlebars templates with marionette
View gist:7540201
The easiest way to use Handlebars with Marionette, including support for AMD / RequireJS, is with the Marionette.Handlebars add-on from @AsciiDisco.
Note that this plugin is not yet compatible with Marionette > 0.9.x.
Alternatively, you can use the following code in your main application or main.js file:
Backbone.Marionette.TemplateCache.prototype.compileTemplate = function(rawTemplate) {
return Handlebars.compile(rawTemplate);
Enhanced Handlebars integration with Marionette
View handlebars.render_from_remote.js
* HandleBars remote template loader
* Allows for direct insertion into dom if jQuery selector string is passed (el).
* Returns $.ajax promise regardless so code can attach callbacks externally.
* @example
* // Direct insertion into dom
* Handlebars.renderFromRemote('/media/templates/hello.handlebars', { name: 'Ryan' }, '#content');
rom3r4 / iso639.js
Created November 23, 2013 17:05 — forked from Loddan/iso639.js
View iso639.js
#!/usr/bin/env node
var jsdom = require('jsdom');
var wikipedia = '';
var jquery = '';
jsdom.env(wikipedia, [jquery], function (errors, window) {
var $ = window.$;
var tds = $('table[class="wikitable sortable"] > tr > td');
if (tds.size() % 10 != 0) {
rom3r4 / gist:8088767
Created December 22, 2013 21:41 — forked from ches/gist:243611
View gist:8088767
Warden::Manager.serialize_into_session{|user| }
Warden::Manager.serialize_from_session{|id| User.get(id) }
Warden::Manager.before_failure do |env,opts|
# Sinatra is very sensitive to the request method
# since authentication could fail on any type of method, we need
# to set it for the failure app so it is routed to the correct block
View gist:8209980

This document has now been incorporated into the uWSGI documentation:

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using: