Skip to content

Instantly share code, notes, and snippets.

View kimroen's full-sized avatar

Kim Røen kimroen

View GitHub Profile
#!/bin/bash
# Let's get some color going!
red=$'\e[1;31m'
grn=$'\e[1;32m'
end=$'\e[0m'
# cd to cwd of the script (presumably in it's proper location)
cd "$(dirname "$0")"
printf "\nInstalling Sketch templates..."
(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,
# ------------------------------------------------------------------------------
# FILE: ember.plugin.zsh
# DESCRIPTION: oh-my-zsh ember plugin file.
# AUTHOR: Will Meldon (wdmeldon@gmail.com)
# VERSION: 0.0.1
# ------------------------------------------------------------------------------
# Based (heavily) on composer.plugin.zsh
#
# Ember basic command completion
_ember_get_command_list () {
model: function() {
return request(/* url */);
},
setupController: function(controller, model) {
// This is the function that normally sets the result of `model` to the `model` property on the controller
controller.set('tacos', model.tacos);
}
@kimroen
kimroen / controllers.application.js
Last active August 29, 2015 14:28
Basic QueryParams
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
queryParams: ['name'],
name: 'Kim'
});
@kimroen
kimroen / gist:1225116
Created September 18, 2011 14:23
Dragon for Lincoln
class Creature
def self.metaclass; class << self; self; end; end
def self.traits(*arr)
return @traits if arr.empty?
#1. Set up accessors for each variable
attr_accessor *arr
@kimroen
kimroen / script.js
Created March 2, 2012 14:43
Forsøk på å endre farge på tooltip ved click
$("#main-button").tooltip();
$("#main-button").click(function() {
$(this).tooltip('hide');
// css-endringer eller sette på ny klasse
$(".tooltip-inner").css('background-color', 'red');
$(this).tooltip('show');
});
@kimroen
kimroen / hack.sh
Created March 31, 2012 15:28 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@kimroen
kimroen / dabblet.css
Created March 26, 2013 11:10
Pido-knapp
/**
* Pido-knapp
* The first commented line is your dabblet’s title
*/
html {
background: linear-gradient(top, white, hsl(0,0%,95%)) no-repeat;
min-height: 100%;
font-family: sans-serif;
}
@kimroen
kimroen / high-dpi-media.scss
Created November 20, 2012 10:24 — forked from marcedwards/high-dpi-media.css
A Sass media query mixin that captures almost all high DPI aware devices.
/* ----------------------------------------------------------------------- */
/* */
/* Improved upon a mixin from 37signals and combined */
/* with these numbers from marc. */
/* */
/* 37signals-version: */
/* http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss */
/* */
/* @kimroen */
/* */