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

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
fhemberger / talks.md
Last active Aug 29, 2015
FrOSCon 2014 Cologne.js JavaScript track
View talks.md
@fhemberger
fhemberger / README.md
Last active Dec 27, 2015
Get rid of content farms and W3Schools in search results.
View README.md
@fhemberger
fhemberger / backup-uberspace.exclude
Created Oct 17, 2013
How to easily backup your Uberspace (http://uberspace.de) account with rsync
View backup-uberspace.exclude
.gem
.npm
cgi-bin
fcgi-bin
html
lib
man
share
tmp
**/node_modules
@fhemberger
fhemberger / index.html
Last active Jan 22, 2018
Beispielcode für "Client-Server-Kommunikation mit Socket.io" (Webkrauts-Adventskalender 2012)
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Socket.io Test</title>
<!-- Dieses Script wird von Socket.io automatisch zu Verfügung gestellt -->
<script src="/socket.io/socket.io.js"></script>
<script>
// Mit dem Socket.io-Server verbinden
@fhemberger
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 ] = {
publish: callbacks.fire,
subscribe: callbacks.add,
unsubscribe: callbacks.remove
};
@fhemberger
fhemberger / gist:2665360
Created May 12, 2012
Loose comparison with == in JavaScript
View gist:2665360
<!DOCTYPE html>
<html>
<head>
<style>
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.