This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var csrf_token = $("meta[name='csrf-token']").attr("content"); | |
| $("body").bind("ajaxSend", function(elm, xhr, s){ | |
| if (s.type == "POST" || s.type == "PUT" || s.type == "DELETE") { | |
| xhr.setRequestHeader('X-CSRF-Token', csrf_token); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # gems | |
| gem 'resque' | |
| # the data | |
| gem 'devise' | |
| gem 'carrierwave' | |
| gem 'fog' | |
| gem 'rmagick' | |
| # controllers and views |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Test</title> | |
| <script src="js/jquery.js" type="text/javascript"></script> | |
| <script src="js/underscore.js" type="text/javascript"></script> | |
| <script src="js/backbone.js" type="text/javascript"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| $(function(){ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config = _.map [ | |
| [1, "Important", "Urgent"] | |
| [2, "Important", "Not Urgent"] | |
| [3, "Not Important", "Not Urgent"] | |
| [4, "Not Important", "Not Urgent"] | |
| ], (x) -> {id:x[0], vtitle:x[1], htitle:x[2]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| function compress($buffer) { | |
| /* remove comments */ | |
| $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer); | |
| /* remove tabs, spaces, newlines, etc. */ | |
| $buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer); | |
| return $buffer; | |
| } | |
| function getTemplate($filename) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| COMPRESS=true | |
| YUI_COMPRESSOR_PATH="../../tools/YUI_Compressor/build/yuicompressor-2.4.6.jar" | |
| ### JS FILES ### | |
| # CONFIG | |
| MAIN_FILE_NAME="app" | |
| MAIN_FILE_PATH="../assets/$MAIN_FILE_NAME.js" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'http://rubygems.org' | |
| gem 'sass' | |
| gem 'coffee-script' | |
| gem 'yui-compressor' | |
| gem 'handlebars_assets' | |
| gem 'sprockets' | |
| gem 'rb-fsevent' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function hideAddressBar() | |
| { | |
| if(!window.location.hash) | |
| { | |
| if(document.height < window.outerHeight) | |
| { | |
| document.body.style.height = (window.outerHeight + 50) + 'px'; | |
| } | |
| setTimeout( function(){ window.scrollTo(0, 1); }, 50 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS | |
| Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing). | |
| The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here: | |
| * Heroku Hostname SSL | |
| * GoDaddy Standard SSL Certificate | |
| * Zerigo DNS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // lodash extension to evaluate expressions | |
| _.eval = function(expression, scope) { | |
| return _.template("<%= " + expression + " %>")(scope); | |
| } | |
| _.eval = function(expression) { | |
| return _.template("<%= " + expression + " %>"); | |
| } |
OlderNewer