This file contains 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
# CSS/JS auto-versioning | |
RewriteEngine On | |
RewriteRule ^(.*)\.[\d]{10}\.(css|js)$ $1.$2 [L] |
This file contains 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
// Sometimes it's necessary to do a bit of clean-up | |
Array.prototype.forEach.call(document.querySelectorAll('.js-comment-delete button'), function(el, i) { | |
el.removeAttribute('data-confirm'); | |
el.click(); | |
}); |
This file contains 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/sh | |
# | |
# Diffs the bundles of a branch with master. | |
# | |
BRANCH=$1 | |
# Don't build master if we already have it | |
if [ ! -d "build_master" ]; then | |
echo 'Building "master" branch bundle...' |
This file contains 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
SSH_USER = 'test' | |
SSH_HOST = 'example.com' | |
SSH_DIR = '/home/test/website/releases' | |
RSYNC = false | |
desc "Run the preview server at http://localhost:4567" | |
task :preview do | |
system("middleman server") | |
end |
This file contains 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
database: | |
override: | |
- mv config/database.ci.yml config/database.yml | |
- RAILS_ENV="test" RACK_ENV="test" bundle exec rake db:create db:structure:load ts:configure ts:index ts:start --trace |
This file contains 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
# app/models/item.rb | |
require 'concerns/sortable' | |
class Item < ActiveRecord::Base | |
include Sortable | |
attr_accessible :title | |
end |
This file contains 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
<% if paginate && num_pages > 1 %> | |
<div class="pagination"> | |
<% if prev_page %> | |
<%= link_to '<i class="icon-arrow-left"></i> Prev', prev_page, class: 'prev page-numbers' %> | |
<% else %> | |
<span class="disabled"><i class="icon-arrow-left"></i> Prev</span> | |
<% end %> | |
<% for p in 1..num_pages %> | |
<% if p == page_number %> |
This file contains 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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
init() { | |
this._super(...arguments); | |
console.log('init!!1'); | |
}, | |
willDestroy() { | |
console.log('noooo dsetroyer'); |
This file contains 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
<?php | |
/** | |
* Encrypts a "secrets.json" file using mcrypt | |
* | |
* Usage: php secrets_encrypt.php > secrets.ejson | |
*/ | |
require(dirname(__FILE__) . '/key.php'); | |
function _secrets_encrypt($string) { |
This file contains 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
// Download rollbar.js and rollbar.min.js from: | |
// http://d37gvrvc0wt4s1.cloudfront.net/js/1/rollbar.js | |
// http://d37gvrvc0wt4s1.cloudfront.net/js/1/rollbar.min.js | |
// | |
// Place them into vendor/ and this code into lib/rollbar.js, or something | |
(function(w, d) { | |
w._rollbarParams = { | |
"server.environment": "production", | |
"notifier.snippet_version": "2" |
NewerOlder