Skip to content

Instantly share code, notes, and snippets.

View follesoe's full-sized avatar
📱

Jonas Follesø follesoe

📱
View GitHub Profile
Jonas-Folless-iMac:~ follesoe$ brew install vcprompt
/usr/local/bin/hg
==> Cloning hg://http://vc.gerg.ca/hg/vcprompt/
Updating /Users/follesoe/Library/Caches/Homebrew/vcprompt--hg
pulling from http://vc.gerg.ca/hg/vcprompt/
searching for changes
no changes found
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
==> make
/usr/bin/cc -Wall -Wextra -Wno-unused-parameter -g -O2 -c -o src/common.o src/common.c
export HOME=/Users/jf
export PS1='\[$(tput setaf 2)\]\u\[$(tput sgr0)\]@\[$(tput setaf 3)\]\h\[$(tput sgr0)\] \w\[$(tput setaf 5)\]`if [ "$(vcprompt)" != "" ]; then echo " $(vcprompt)"; fi`\[$(tput setaf 2)\]`if [ "$(~/.rvm/bin/rvm-prompt i v)" != "" ]; then echo " $(~/.rvm/bin/rvm-prompt i v)"; fi` \[$(tput sgr0)\]∴ '
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
export PATH=/usr/local/lib/node/.npm:$PATH
export NODE_PATH=/usr/local/lib/node:$NODE_PATH
Modernizr.addTest("pinnedsite", function() {
try {
return window.external.msIsSiteMode();
}
catch(e) {
return false;
}
});
@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();
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; });
@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")
@follesoe
follesoe / free_sms_1.cs
Created December 24, 2010 13:40
First code snippet from blog post on free SMS
// Copyright (c) 2007, Jonas Follesø
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
@follesoe
follesoe / free_sms_2.cs
Created December 24, 2010 13:43
Second code snippet from blog post on free SMS
// Copyright (c) 2007, Jonas Follesø
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
@follesoe
follesoe / free_sms_gadget_1.js
Created December 24, 2010 13:55
Snippet for the blog post "Free SMS Gadget for Vista using .NET Interop"
// Instance of the GadgetBuilder to load/unload .NET assemblies. See GadgetInterop.js.
var builder = new GadgetBuilder();
// Initialize the adapter to call .NET assemblies.
builder.Initialize();
// Use the builder to add the username and password as constructor argument values.
builder.AddConstructorParam(username);
builder.AddConstructorParam(password);
@follesoe
follesoe / free_sms_gadget_2.js
Created December 24, 2010 13:56
Snippet for the blog post "Free SMS Gadget for Vista using .NET Interop"
////////////////////////////////////////////////////////////////////////////////
//
// Add the Gadget.Interop dll to the registry so it can be used by COM and
// created in javascript as an ActiveX object
//
////////////////////////////////////////////////////////////////////////////////
function RegisterGadgetInterop()
{
try
{