Skip to content

Instantly share code, notes, and snippets.

Frederic Hemberger fhemberger

Block or report user

Report or block fhemberger

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
fhemberger /
Last active Jan 26, 2020
Node.js: Create checksums for npm's 'postinstall' actions

Node.js: Create checksums for npm's 'postinstall' actions

After watching Patrick Debois' talk from DeliveryConf »How Secure Is Your Build / Server?«, I tried to get at least a rough idea if postinstall steps where running at all and if they do the same things after a package update.

So I wrote a little proof of concept that will:

  • Create a Dockerfile, using package.json and package-lock.json from a Node.js project in the current directory
  • Install all its dependencies inside the Docker container first, without running any postinstall steps, then do the same with running the scripts.
  • Reading the diff of those steps using Docker's image layers
  • And calculate a checksum of those changes.
View gist:c4881830a3c36405de20329bf5e84d4a
A Scanner Darkly (2006)
A.D. Police File 1: The Phantom Woman (1990)
A.D. Police File 2: The Ripper (1990)
A.D. Police File 3: The Man Who Bites His Tongue (1990)
Akira (1988)
Appleseed (2004)
Appleseed Alpha (2014)
Appleseed: Ex Machina (2007)
Armitage III (1995)
Armitage III: Poly Matrix (1996)
View gist:3676b14899a4591498b3

I'm using the git pr command from the git-extras toolset to check out a local copy of a PR.

To rebase the PR again, I wrote a little script, which needs to be run in the PR's branch:

#!/usr/bin/env bash

branch=$(git symbolic-ref HEAD --short)

git rebase master
fhemberger /
Last active Aug 29, 2015
FrOSCon 2014 Cologne.js JavaScript track
fhemberger /
Last active Dec 27, 2015
Get rid of content farms and W3Schools in search results.
fhemberger / backup-uberspace.exclude
Created Oct 17, 2013
How to easily backup your Uberspace ( account with rsync
View backup-uberspace.exclude
fhemberger / index.html
Last active Jan 22, 2018
Beispielcode für "Client-Server-Kommunikation mit" (Webkrauts-Adventskalender 2012)
View index.html
<!DOCTYPE html>
<title> Test</title>
<!-- Dieses Script wird von automatisch zu Verfügung gestellt -->
<script src="/"></script>
// Mit dem verbinden
fhemberger / gist:3974360
Created Oct 29, 2012
Pubsub with jQuery $.Callbacks
View gist:3974360
var topics = {};
$.Topic = function( id ) {
if ( !topics[ id ] ) {
var callbacks = jQuery.Callbacks();
topics[ id ] = {
subscribe: callbacks.add,
unsubscribe: callbacks.remove
fhemberger / gist:2665360
Created May 12, 2012
Loose comparison with == in JavaScript
View gist:2665360
<!DOCTYPE html>
body { font-family: Arial, sans-serif; }
th, td {
text-align: center;
padding: 10px;
th { background-color: #f0f0f0; }
You can’t perform that action at this time.