Skip to content

Instantly share code, notes, and snippets.

View robbestad's full-sized avatar
🎯
Focusing

Sven Anders Robbestad robbestad

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python
# This script lets you initalize a new repo on github
# from the command line
# All you need is a github user and a password
# 11. sep 2013 @ Svenardo
# License: CC0 1.0 Universal (CC0 1.0)
import os
import subprocess
#!/opt/local/bin/python2.7
__author__ = 'svenanders'
import sys
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
'''
>>> startserver 8000
Serving HTTP on 127.0.0.1 port 8000 ...
'''
@robbestad
robbestad / limitFromTo.js
Last active December 27, 2015 07:29
Limit From-To filter for AngularJS
/**
* @name limitFromTo
* @by Sven Anders Robbestad, 2013
* @license CC0 1.0 Universal (CC0 1.0)
* @description
* Limit From-To filter for AngularJS.
* Creates a new array or string containing only a specified number of elements with an extra
* parameter specifying the starting point..
* The elements are taken from either the beginning or the end of the source array or string, as
* specified by the value and sign (positive or negative) of `limit`.
TODO List
=========
1.5:
- Add a configuration file for nopaste-it with predefined values.
# Add this config
$ heroku config:add LD_LIBRARY_PATH=/app/php/ext:/app/apache/lib
# Login to Heroku CLI
$ heroku run bash
# The second argument here is the path to your script
~ $ ~/php/bin/php -f ~/www/index.php
/*global ig*/
ig.module(
'plugins.persistence.localstorage'
).requires(
'impact.game'
).defines(function () {
'use strict';
ig.PersistenceLocalStorage = ig.Class.extend({
/**
* Initialize Persistence as localStorage
@robbestad
robbestad / resizr.sh
Created May 15, 2014 10:18
Rename & resize images for iOS apps
#!/bin/bash
i=1
for f in orig/*
do
cp "$f" ./app/effekter$i@2x.png
# converts to 300x300
convert "$f" -resize 50% ./app/effekter$i.png
convert "$f" -resize 100x ./app/_effekter$i.png
@robbestad
robbestad / metagrid.js
Last active August 29, 2015 14:02
Removed jquery dependency and the need to have an image folder
(function () {
"use strict";
})();
var metaGridNs = metaGridNs || {};
(function () {
var options = {
placeholder: 'body',
id: 'divGrid', // id for the grid container
for f in *.jpg; do convert $f -resize 800x lores/$f; done
@robbestad
robbestad / sharing links.html
Created October 23, 2014 16:46
Sharing links