Updated for Rails 4.0.0+
-
Set up the
bowergem. -
Follow the Bower instructions and list your dependencies in your
bower.json, e.g.// bower.json
{
| #!/bin/bash | |
| libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i32.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i64.2.dylib" \ | |
| "/usr/local/lib/libmacfuse_i64.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i32.la" \ | |
| "/usr/local/lib/libosxfuse_i64.la" \ | |
| "/usr/local/lib/pkgconfig/osxfuse.pc" ) |
Updated for Rails 4.0.0+
Set up the bower gem.
Follow the Bower instructions and list your dependencies in your bower.json, e.g.
// bower.json{
| #!/bin/bash | |
| mkdir -p ~/.ssh | |
| # generate new personal ed25519 ssh keys | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>" | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <rob@rob.tn>" | |
| # generate new host cert authority (host_ca) ed25519 ssh key | |
| # used for signing host keys and creating host certs |
| name | default_version | installed_version | comment | |
| ------------------------+-----------------+-------------------+--------------------------------------------------------------------- | |
| pg_buffercache | 1.0 | | examine the shared buffer cache | |
| earthdistance | 1.0 | | calculate great-circle distances on the surface of the Earth | |
| pg_freespacemap | 1.0 | | examine the free space map (FSM) | |
| intagg | 1.0 | | integer aggregator and enumerator (obsolete) | |
| plperl | 1.0 | | PL/Perl procedural language | |
| sslinfo | 1.0 | | information about SSL certificates | |
| btree_gist | 1.0 | | support for indexing common datatypes in GiST | |
| fuzzystrmatch | 1.0 |
| class @GoogleAnalytics | |
| @load: -> | |
| # Google Analytics depends on a global _gaq array. window is the global scope. | |
| window._gaq = [] | |
| window._gaq.push ["_setAccount", GoogleAnalytics.analyticsId()] | |
| # Create a script element and insert it in the DOM | |
| ga = document.createElement("script") | |
| ga.type = "text/javascript" |
| -- Related blog post to this Gist: | |
| -- https://torsten.io/stdout/expanding-json-arrays-to-rows | |
| -- Run these commands on a interactive RedShift session: | |
| CREATE TEMP TABLE clusters AS ( | |
| SELECT 1 AS id, '[1, 2]' AS node_sizes UNION ALL | |
| SELECT 2 AS id, '[5, 1, 3]' AS node_sizes UNION ALL | |
| SELECT 3 AS id, '[2]' AS node_sizes | |
| ); |
| http://robots.thoughtbot.com/convert-ruby-1-8-to-1-9-hash-syntax | |
| search = :([^ ]*)(\s*)=> | |
| replace = $1: |
| // In app.js or main.js or whatever: | |
| // var myApp = angular.module('askchisne', ['ngSanitize', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']); | |
| // This filter makes the assumption that the input will be in decimal form (i.e. 17% is 0.17). | |
| myApp.filter('percentage', ['$filter', function ($filter) { | |
| return function (input, decimals) { | |
| return $filter('number')(input * 100, decimals) + '%'; | |
| }; | |
| }]); |
| $.rails.allowAction = function(link) { | |
| if (!link.attr('data-confirm')) { | |
| return true; | |
| } | |
| $.rails.showConfirmDialog(link); | |
| return false; | |
| }; | |
| $.rails.confirmed = function(link) { | |
| link.removeAttr('data-confirm'); |
| class APIController < ApplicationController | |
| include JSONErrors | |
| # ... | |
| end |