Skip to content

Instantly share code, notes, and snippets.

View eirikb's full-sized avatar

Eirik Brandtzæg eirikb

  • Softeria AS
  • Ålesund, Norway
View GitHub Profile
@eirikb
eirikb / dep.js
Created June 24, 2014 10:39
Dependencyhackjection
var d={a:1,b:2},f=function(a,b){return a+b};f.apply(null,(''+f).match(/function[^(]*\(([^)]*)\)/)[1].split(/,\s*/).map(function(x){return d[x]}))
@eirikb
eirikb / paging.html
Created November 16, 2014 22:15
SharePoint paging
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0/angular-sanitize.min.js"></script>
<div ng-app="test-paging" ng-controller="ListController">
<table class="table table-bordered">
<tr ng-repeat="item in items">
<td>{{item.Title}}</td>
<td ng-bind-html="item.Body"></td>
</tr>
@eirikb
eirikb / example.js
Last active August 29, 2015 14:17
nodify
var nodify = require('nodify');
// Prints build time
console.log(nodify(function() {
return new Date();
}));
// Prints current time
console.log(new Date());
public static FileInformation GetFile(ClientContext clientContext, string fileRef)
{
using (var clientContextHack = new ClientContext(clientContext.Url))
{
return File.OpenBinaryDirect(clientContextHack, fileRef);
}
}
function fail() {
omg / lol;
};
$(function() {
DNode().connect(function(remote) {
remote.hello(function() {
fail();
});
});
});
git filter-branch -f --commit-filter '
if [ "$GIT_AUTHOR_NAME" = "eirikb@heavyload" ];
then
GIT_COMMITTER_NAME="<Eirik Brandtzæg>";
GIT_AUTHOR_NAME="<Eirik Brandtzæg>";
GIT_COMMITTER_EMAIL="<eirikb@eirikb.no>";
GIT_AUTHOR_EMAIL="<eirikb@eirikb.no>";
git commit-tree "$@";
else
git commit-tree "$@";
$ mvn clojure:test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building comicparser 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- clojure-maven-plugin:1.3.4:test (default-cli) @ comicparser ---
Testing no.eirikb.comicparser.comicparser
{
"image":{
"operatingSystem":{
"family":"UBUNTU",
"arch":"paravirtual",
"version":"",
"description":"DB2 Express-C 9.7.1 on Ubuntu 9.10 i386 - 20100407",
"is64Bit":false
},
"description":"DB2 Express-C 9.7.1 running on Ubuntu 9.10. Built 2010-04-07",
@eirikb
eirikb / helloworld.lett
Created November 2, 2011 12:05
Lett da
my.test-lib: {
a: 'hello',
b: 'world',
c: 1337,
t: true,
f: false,
inner.object: 'Works!',
my.very-inner.object: 7,
nesting-test: +(1 2 3 -(6 1)),
string-test: str('hello' ', ' 'world'),
[eirikb@eeeirik mineserver2]$ cmake .
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1197 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
CMakeLists.txt:59 (FIND_PACKAGE)