Skip to content

Instantly share code, notes, and snippets.

View mahnouel's full-sized avatar

Manuel mahnouel

  • 3pc GmbH Neue Kommunikation
  • Berlin
  • 01:18 (UTC +02:00)
View GitHub Profile
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@kiewic
kiewic / xhubsignature.js
Created November 17, 2016 08:39
How to validate a X-Hub-Signature header when using Express.js and body-parser
var express = require('express');
var bodyParser = require('body-parser')
var crypto = require('crypto');
// Calculate the X-Hub-Signature header value.
function getSignature(buf) {
var hmac = crypto.createHmac("sha1", process.env.FB_APP_SECRET);
hmac.update(buf, "utf-8");
return "sha1=" + hmac.digest("hex");
}
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git