Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@howardroark
howardroark / Backbone.Marionette.TemplateView.js
Last active January 14, 2016 21:23
TemplateView gives template designers more control without the need to get into the code.
Backbone.Marionette.TemplateView = Backbone.Marionette.ItemView.extend({
templateEl: false,
inlineTemplate: false,
render: function() {
if(this.inlineTemplate) {
this.templateEl = true;
this.templateConfig = jQuery(this.inlineTemplate).data();
this.template = Backbone.Marionette.TemplateCache.get(this.inlineTemplate);
}
/usr/local/node:
archive.extracted:
- source: https://nodejs.org/dist/v4.2.2/node-v4.2.2-linux-x64.tar.gz
- source_hash: sha256=5c39fac55c945be3b8ac381a12bdbe3a64a9bdc5376d27e2ce0c72160eff5942
- archive_format: tar
- tar_options: --strip-components 1
/usr/local/bin/node:
file.symlink:
- target: /usr/local/node/bin/node
@howardroark
howardroark / gist:00c2957578887b0f40db
Created September 24, 2015 17:22
Verifying that +howardroark is my blockchain ID. https://onename.com/howardroark
Verifying that +howardroark is my blockchain ID. https://onename.com/howardroark
@howardroark
howardroark / gist:ea575d24645b231540f8
Created June 19, 2015 00:22
index.html rewrites for Craft CMS
# Rewrite rules to allow AWS cloudfront to cache CMS pages
location = /index.html {
rewrite /index.html /index.php?p=index last;
}
location ~ index.html$ {
rewrite ^/(.*)/index.html$ /index.php?p=$1? last;
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu1404"
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.provision :shell, inline: $install_nvmnode
end
$install_nvmnode = <<SCRIPT
import requests
class HoverException(Exception):
pass
class HoverAPI(object):
def __init__(self, username, password):
params = {"username": username, "password": password}
r = requests.post("https://www.hover.com/api/login", params=params)
server {
root /path/to/app/public;
index index.php;
server_name test.dev;
set $cors_headers "whatever-custom-headers,you-would-like";
# redirection to index.php
location / {
try_files $uri $uri/ /index.php?$query_string;
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['backbone.marionette', 'backbone.radio', 'underscore'], function(Marionette, Radio, _) {
return factory(Marionette, Radio, _);
});
}
else if (typeof exports !== 'undefined') {
var Marionette = require('backbone.marionette');
var Radio = require('backbone.radio');
var _ = require('underscore');
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
import requests
class HoverException(Exception):
pass
class HoverAPI(object):
def __init__(self, username, password):
params = {"username": username, "password": password}
r = requests.post("https://www.hover.com/api/login", params=params)