Skip to content

Instantly share code, notes, and snippets.

View ssured's full-sized avatar
🙊
\> say "ssured"

Sjoerd de Jong ssured

🙊
\> say "ssured"
View GitHub Profile
@dagda1
dagda1 / union.js
Last active August 29, 2015 13:58
App.computed.union = function() {
var args, options, properties;
properties = a_slice.call(arguments);
args = properties.map((function(_this) {
return function(prop) {
return "" + prop;
};
})(this));
@krisselden
krisselden / index.hbs
Created April 25, 2014 06:01
sortable-list component example
{{#each fruits}}
{{this}}
{{/each}}
{{draggable-list values=fruits}}
@ef4
ef4 / gist:82f37eb5dae4e56467b6
Created June 16, 2014 21:13
Example Application Cache "Bootloader"
(function(){
function useManifest(content){
var tag;
var stylesheets = content.match(/\/css\/.*\.css/g);
for (var i=0; i<stylesheets.length; i++){
tag = document.createElement('link');
tag.href = stylesheets[i];
tag.rel = "stylesheet";
document.getElementsByTagName('head')[0].appendChild(tag);
@pkgw
pkgw / xpdf-extract-helper.sh
Created October 15, 2012 14:22
Helper to use XPDF to extract figures from PDFs as vector graphics
#! /bin/bash
# -*- shell-script -*-
margin=4
# XPDF gives its y coordinates in terms of the standard PDF coordinate
# system, where (0,0) is the bottom left corner and y increases going
# up. But pdftocairo uses Cairo coordinates, in which (0,0) is the top
# left corner and y increases going down. We can use pdfinfo to get
# the page size to translate between these conventions.
(function (global) {
"use strict";
function empty(obj) {
var key;
for (key in obj) if (obj.hasOwnProperty(key)) return false;
return true;
}
var Ember = global.Ember,
@sebastianseilund
sebastianseilund / merged_array.js
Last active December 20, 2015 07:58
An implementation of a merged array in Ember.js that combines items from multiple source arrays so you can easily list them together in your Handlebars templates. Read the blog post at the [Billy's Billing Developer Blog](http://dev.billysbilling.com/blog/How-to-merge-multiple-data-sources-into-one-array-in-Ember-js)
/**
* `Ember.MergedArray` is an array that observes multiple other arrays (called source arrays) for changes and includes
* all items from all source arrays in an efficient way.
*
* Usage:
*
* ```javascript
* var obj = Ember.Object.create({
* people: [
* {
@manufaktor
manufaktor / application.js
Last active December 23, 2015 08:19
Custom events with ember.js and hammer.js
App = Ember.Application.create({
customEvents: {
swipeLeft: 'swipeLeft',
swipeRight: 'swipeRight',
swipeLeftTwoFinger: 'swipeLeftTwoFinger',
swipeRightTwoFinger: 'swipeRightTwoFinger',
dragDown: 'dragDown',
dragUp: 'dragUp',
dragDownTwoFinger: 'dragDownTwoFinger',
dragUpTwoFinger: 'dragUpTwoFinger'
amqp = require('amqplib')
whence = require('when')
class MessageBus
constructor: (@amqp) ->
if config.rabbit?.url?.
@connect()
else
@createFakeChannel()
@mrozema
mrozema / content-for-group.js
Last active August 2, 2016 03:37
Ember 2.0 compatible select box
import Ember from "ember";
export default Ember.Helper.helper(function([content, group, contentGroupKey]) {
return content.filterBy(contentGroupKey, group);
});
@venj
venj / com.yourcompany.autossh.plist
Created May 30, 2012 14:39
Put following gist to ~/Library/LaunchAgents, and then run: launchctl load /Users/your_name/Library/LaunchAgents/com.yourcompany.autossh.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>OnDemand</key>
<false/>
<key>KeepAlive</key>
<true/>