Skip to content

Instantly share code, notes, and snippets.

Eirik Brandtzæg eirikb

Block or report user

Report or block eirikb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
  1. Download zip.
  2. npm install.
  3. npm test.
eirikb / gulpfile.js
Last active Sep 26, 2017
Gulp + Babel + JSX
View gulpfile.js
var gulp = require('gulp');
var fs = require('fs');
var browserify = require('browserify');
var babelify = require('babelify');
var watchify = require('watchify');
var source = require('vinyl-source-stream');
var livereload = require('gulp-livereload');
var less = require('gulp-less');
var concat = require('gulp-concat');
var connect = require('gulp-connect');
View example.js
var nodify = require('nodify');
// Prints build time
console.log(nodify(function() {
return new Date();
// Prints current time
console.log(new Date());
eirikb / paging.html
Created Nov 16, 2014
SharePoint paging
View paging.html
<link rel="stylesheet" href="//">
<script src="//"></script>
<script src="//"></script>
<script src="//"></script>
<div ng-app="test-paging" ng-controller="ListController">
<table class="table table-bordered">
<tr ng-repeat="item in items">
<td ng-bind-html="item.Body"></td>
eirikb / dep.js
Created Jun 24, 2014
View dep.js
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]}))
View OpenBinaryDirect.cs
public static FileInformation GetFile(ClientContext clientContext, string fileRef)
using (var clientContextHack = new ClientContext(clientContext.Url))
return File.OpenBinaryDirect(clientContextHack, fileRef);
eirikb / imgur-oauth-test.html
Last active Aug 30, 2019
Post to imgur using oauth (api v3) on a static (no server) site
View imgur-oauth-test.html
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>imgur oauth</title>
<script src=""></script>
$(function () {
var extractToken = function(hash) {
eirikb / index.html
Last active Dec 20, 2015
Komplett-sort 2000
View index.html
<p>Lagre som bookmarks/favoritter:</p>
<a href="javascript:$('div[class*=prod]').sort(function(a,b){function d(x){var d=$(x).find('.value').text().match(/\d+/);if(!d)return 0;return parseInt(d[0],10)};return d(b)-d(a)}).each(function(i){$('div[class*=prod]').eq(i).replaceWith(this)});">Komplettsalg - prosent</a>
<a href="javascript:$('div[class*=prod]').sort(function(a,b){function d(x,y){var d=$(x).find(y).text().replace(/\./g,'').match(/\d+/);return d?parseInt(d[0]):0}function dd(x){return d(x,'.priceBefore')-d(x,'.price')}return dd(b)-dd(a)}).each(function(i){$('div[class*=prod]').eq(i).replaceWith(this)});">Komplettsalg - prisforskjell</a>
View IsNumeric.cs
using System;
using System.Linq;
public static class IsNumericExtension
public static bool IsNumeric(this string orig)
return orig.Length > 0 && orig.ToCharArray().All(Char.IsNumber);
You can’t perform that action at this time.