Skip to content

Instantly share code, notes, and snippets.

Bran van der Meer branneman

Block or report user

Report or block branneman

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
@branneman
branneman / profile.ps1
Last active Aug 29, 2015
Powershell custom prompt & some coloring. Here's how it looks: http://bran.name/dump/powershell-prompt.png
View profile.ps1
# Aliasses
Set-Alias l ls
Set-Alias e explorer
# Force coloring of git and npm commands
$env:TERM = 'cygwin' # windows-ansi | cygwin
$env:LESS = 'FRSX'
#
# Custom prompt
@branneman
branneman / gruntfile.js
Last active Aug 29, 2015
Example `grunt-htmllint-http` setup when using http://frntndr.com/
View gruntfile.js
'use strict';
var glob = require('glob');
module.exports = function Gruntfile(grunt) {
var config = grunt.file.readJSON('./app/config');
grunt.loadNpmTasks('grunt-htmllint-http');
@branneman
branneman / Registry.js
Created Nov 6, 2014
AMD Registry Pattern implementation
View Registry.js
/**
* @module Registry pattern implementation
*/
define(function() {
'use strict';
/**
* Constructor
*/
@branneman
branneman / gist:951844
Created May 2, 2011
Remove Excel Password
View gist:951844
Public Sub AllInternalPasswords()
Const DBLSPACE As String = vbNewLine & vbNewLine
Const AUTHORS As String = DBLSPACE & vbNewLine & _
"Adapted from Bob McCormick base code by" & _
"Norman Harker and JE McGimpsey"
Const HEADER As String = "AllInternalPasswords User Message"
Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04"
Const REPBACK As String = DBLSPACE & "Please report failure " & _
"to the microsoft.public.excel.programming newsgroup."
Const ALLCLEAR As String = DBLSPACE & "The workbook should " & _
@branneman
branneman / gist:951833
Created May 2, 2011
Timing script execution at high-precision
View gist:951833
<?php
$time1 = explode(' ', microtime());
$time1 = $time1[1] . substr($time1[0], 1, -2);
// your code
$time2 = explode(' ', microtime());
$time2 = $time2[1] . substr($time2[0], 1, -2);
@branneman
branneman / gist:951858
Created May 2, 2011
Split a array into semi-equal sized chunks
View gist:951858
<?php
/**
* Split a array into semi-equal sized chunks.
* A so-called 'columnizer'
*
* @param array $array The array to split
* @param array $numberOfChunks The number of chunks
* @param bool $vertical Whether to order vertically or horizonally
*
* @return array Array with $numberOfColumns nodes with items of $array
View changepassword.bat
@echo off
@echo This batchfile changes your password 30 times into a temporary password, and finally into your given password.
@echo This way, you can use your 'old' password, when you are forced to change it ;)
SET /P user=username:
SET /P pwd=password:
echo username: %user%
net user %user% C6us4deSAf /domain
View ramda-generate-since-docblock.js
var R = require('ramda');
var IO = require('ramda-fantasy').IO;
var Either = require('ramda-fantasy').Either;
var glob = require('glob');
var exec = cmd => require('child_process').execSync(cmd, { encoding: 'utf8' });
// getFiles :: IO [String]
var getFiles = () => new IO(() => glob.sync('src/*.js'));
View gulpfile.js
var gulp = require('gulp');
require('./tasks-css');
require('./tasks-js');
// etc.
gulp.task('dev', ['browsersync', 'html-watch', 'img-watch', 'css-watch', 'js-watch']);
gulp.task('dist', ['clean', 'html-compile', 'img-optimize', 'css-compile', 'js-transpile']);
// etc.
@branneman
branneman / functional-composition-with-functor-map.js
Last active Oct 29, 2015
Functional Composition through functor map
View functional-composition-with-functor-map.js
// add :: Number -> Number -> Number
var add = function(left) { return function(right) { return left + right } };
// multiply :: Number -> Number -> Number
var multiply = function(left) { return function(right) { return left * right } };
// map :: (a -> b) -> Functor a -> Functor b
var map = function(fn, val) { return val.map(fn) };
//
You can’t perform that action at this time.