Skip to content

Instantly share code, notes, and snippets.

View follesoe's full-sized avatar
📱
Working on Skredvarsel app

Jonas Follesø follesoe

📱
Working on Skredvarsel app
View GitHub Profile
@follesoe
follesoe / 0_reuse_code.js
Created February 10, 2014 13:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("")
base = alphabet.length
exports.encode = (i) ->
return alphabet[0] if i is 0
s = ""
while i > 0
s += alphabet[i % base]
i = parseInt(i / base, 10)
@follesoe
follesoe / gist:5056055
Last active December 14, 2015 08:08 — forked from lillesand/gist:5056052
window.onerror = function(errorMsg, url, lineNumber) {
alert('noobface, plz');
alert('foo');
};
@follesoe
follesoe / git_tips.md
Created May 22, 2012 17:01 — forked from rainly/git_tips.md
Git Tips

(Several of these git examples have been extracted from the book 'Pragmatic guide to GIT' of Travis Swicegood )

Git tips

Global git user

git config --global user.name "Fernando Guillen"
git config --global user.email "fguillen.mail+spam@gmail.com"

Repository git user

cd /develop/myrepo

@follesoe
follesoe / gist:963480
Created May 9, 2011 21:42 — forked from Clancey/gist:963345
My testflight post build script
//After build
Command : cp -r ${ProjectDir}/bin/iPhone/Release/MyAppName.app toZip/Payload
Working Directory: ${SolutionDir}
//AfterBuild
Command : zip -r ../MyApp.ipa *
WorkingDirectory: ${SolutionDir}/toZip
@root_dir = File.expand_path(File.join(File.dirname(__FILE__), "../../"))
$: << File.join(@root_dir, "lib")
$: << File.join(@root_dir, "spec")
$: << File.join(@root_dir, "spec/patches")
$: << File.join(@root_dir, "spec/support")
$: << File.join(@root_dir, "lib/albacore/config")
string xml = @"
<root xmlns='http://www.w3.org/TR/html4/' xmlns:h='http://www.w3.org/TR/html4/' xmlns:f='http://www.w3schools.com/furniture'>
<h:table><h:tr><h:td>Apples</h:td><h:td>Bananas</h:td></h:tr></h:table><f:table><f:name>African Coffee Table</f:name>
<f:width>80</f:width><f:length>120</f:length></f:table></root>";
XElement x = XElement.Parse(xml);
(from node in x.DescendantsAndSelf()
where node is XElement
from attr in node.Attributes()
where attr.IsNamespaceDeclaration && attr.Name.LocalName == "xmlns"
select attr).All(attr => { attr.Remove(); return true; });
@follesoe
follesoe / gist:629764
Created October 16, 2010 13:07 — forked from remy/gist:350433
if (!window.localStorage || !window.sessionStorage) (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();