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/bash | |
# | |
# ember - Ember.JS starter kit script | |
# Download this and place it into e.g. /usr/local/bin | |
# | |
# Original: https://github.com/Darep/dotfiles/blob/master/bin/ember | |
# | |
[ -z "$1" ] && echo "No argument supplied" && exit |
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
// Converts pixels to EMs | |
// Usage: em(16) em(16px) em(16, 24) em(16px, 24px) em(16px, 1em) | |
@function strip-units($number) { | |
@return $number / ($number * 0 + 1); | |
} | |
@function em($pixels, $context: 16) { | |
$base: 16; | |
$value: strip-units($pixels); | |
$value_unit: unit($pixels); |
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
fi: | |
viewer: | |
comment_on_twitter: 'Kommentoi Twitterissä' | |
older: 'Vanhemmat' | |
newer: 'Uudemmat' | |
feed: 'Syöte' | |
share: 'Jaa' | |
close: 'Sulje' | |
next_post: 'Seuraava artikkeli' | |
previous_post: 'Edellinen artikkeli' |
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
(ns beatstream.songs | |
(:require clojure.java.io) | |
(:import [org.jaudiotagger.audio AudioFileIO] | |
[org.jaudiotagger.tag FieldKey])) | |
(def music-path "/Users/ajk/Music/") | |
(defn get-song-files [directory] | |
(->> directory | |
clojure.java.io/file |
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" |
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
// Get value from a Sass list of key-value items (helper function) | |
@function match($collection, $key) { | |
@each $item in $collection { | |
$index: index($item, $key); | |
@if $index { | |
$return: if($index == 1, 2, $index); | |
@return nth($item, $return); | |
} | |
} | |
@return false; |
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
/** | |
Helper for rendering a component dynamically by supplying a name. | |
NOTE: Only works on Ember.js 1.9 and lower, does not work on 1.10+. | |
Ember 1.11 will have this feature built-in. | |
Usage: {{render-component widgetName someData=some.data}} | |
*/ | |
Ember.Handlebars.registerHelper('render-component', function(context, options) { | |
var componentName = Ember.Handlebars.get(this, context, options); | |
var helper = Ember.Handlebars.resolveHelper(options.data.view.container, componentName); |
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 DS.ActiveModelAdapter.extend({ | |
host: 'https://output.jsbin.com', | |
namespace: 'zufarix', | |
buildURL: function (modelName, id, snapshot, requestType, query) { | |
var url = this._super(modelName, id, snapshot, requestType, query); | |
url = url.replace('colors/', '') + '.json'; | |
return url; |
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) { |