Skip to content

Instantly share code, notes, and snippets.

View balpha's full-sized avatar

Benjamin Dumke-von der Ehe balpha

View GitHub Profile
@balpha
balpha / Program.cs
Created May 4, 2016 12:46
Job title and company name generator
using System;
using System.Linq;
namespace FakeJobInfo
{
class Program
{
private static Func<int, int> rand = new Random().Next;
@balpha
balpha / keybase.md
Created February 9, 2016 08:37
Keybase proof

Keybase proof

I hereby claim:

  • I am balpha on github.
  • I am balpha (https://keybase.io/balpha) on keybase.
  • I have a public key ASB1wpE_W0_fAha4Ur732LkFI4Eb4TzhfMbpLjs_HFurfgo

To claim this, I am signing this object:

// replacer is a function that receives the full matched string
// as the first argument and the regex's groups as the following
// arguments (similar to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter,
// except "offset" and "string"). It can return either a simple string,
// or a full DOM node.
//
// node is the document node from which to start (i.e. descend from)
function replaceTextWithElement(node, regex, replacer, skipCode) {
var len,