Skip to content

Instantly share code, notes, and snippets.

View hussfelt's full-sized avatar
:shipit:
All in - no fold.

Henrik Hussfelt hussfelt

:shipit:
All in - no fold.
View GitHub Profile
@hussfelt
hussfelt / gist:3246917
Created August 3, 2012 11:54 — forked from ffub/gist:1084424
Balsamiq HTML export
#!/usr/bin/php
<?php
error_reporting(E_ALL);
if (count($argv) <= 1) {
print("usage createMockup src_dir dst_dir images_dir\n");
print("\tsrc_dir : dir where all bmml file are\n");
print("\tdst_dir : dir where write all html files\n");
print("\timages_dir : dir where all export mockup png are (will be copied to the \$dst_dir/images directory)\n");
exit(1);
}
@hussfelt
hussfelt / deploy.sh
Created October 22, 2012 11:29
Minimal Race-free Deployment
#!/bin/sh
# deploy.sh
N="`readlink \"$1\"`"
mv -T "$1.stage" "$1"
ln -s "$N" "$1.stage"
rm -rf "$N"
cp -aH "$1" "$N"
from fabric.api import env, run, sudo, local, put
def production():
"""Defines production environment"""
env.user = "deploy"
env.hosts = ['example.com',]
env.base_dir = "/var/www"
env.app_name = "app"
env.domain_name = "app.example.com"
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name }
➜ app git:(development) git checkout master
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `materialize': Could not find rake-10.0.3 in any of the sources (Bundler::GemNotFound)
from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'

Keybase proof

I hereby claim:

  • I am hussfelt on github.
  • I am hussfelt (https://keybase.io/hussfelt) on keybase.
  • I have a public key whose fingerprint is 91F4 D3C0 B19E 314F 9030 58C8 A5B9 D303 A6A9 4D1A

To claim this, I am signing this object:

@hussfelt
hussfelt / README.md
Last active August 29, 2015 14:15 — forked from masha256/README.md

Description

A Dashing widget to show a Google Visualizations Gauge on a dashboard.

Installation

Copy the google_gauge.coffee, google_gauge.html and google_gauge.scss file to into /widgets/google_gauge directory.

Add the following to the dashboard layout file:

@hussfelt
hussfelt / README.md
Last active October 13, 2022 07:03
Dashing widget to display an iframe with specified src

dashing-iframe

IFrame plugin for dashing

Description

Dashing widget to display an iframe with specified src

Installation

Create the folder iframe in the /widgets/ directory. Put the files iframe.coffee, iframe.html and iframe.scss in that folder.

@hussfelt
hussfelt / gist:911c58fd668ba422b688
Last active December 10, 2023 12:46 — forked from kjunggithub/gist:8330157
git hubflow cheaetsheet

Git HubFlow Cheat Sheet

Preparing the repository

Create the repository on GitHub/Bitbucket. Once created, clone the created repository to your local machine using:

git clone git@github.com:username/repository.git

CD into the repository folder and run the init command to enable to hub flow tools:

cd repo_name
@hussfelt
hussfelt / gist:6f4d33a68206c30a9d18
Last active August 29, 2015 14:26 — forked from Dhaulagiri/gist:cf5787663d9f93e99d05
Ember Data 2.0 JSONAPISerializer
import DS from 'ember-data';
import Ember from 'ember';
export default DS.JSONAPISerializer.extend({
normalizeArrayResponse: function(store, primaryModelClass, payload, id, requestType) {
var data = {},
extracted = [],
root = 'data',
type = Ember.String.pluralize(primaryModelClass.modelName);
@hussfelt
hussfelt / example_serializer.js
Created August 17, 2015 18:48
Implementation of the new rest-serializer converting data to JSONApi 2.0
import DS from 'ember-data';
import rest_serializer from 'app/mixins/serializers/rest';
export default DS.RESTSerializer.extend(rest_serializer, {
/**
* [normalizeSingleResponse description]
* @param {[type]} store [description]
* @param {[type]} primaryModelClass [description]
* @param {[type]} payload [description]