Skip to content

Instantly share code, notes, and snippets.

View djekl's full-sized avatar
:octocat:
Working from home

Alan Wynn djekl

:octocat:
Working from home
View GitHub Profile
@djekl
djekl / full-ffmpeg.sh
Last active May 23, 2018 10:13
Install full ffmpeg in debian wheezy (with aac(m4a) and x264 support)
# !/bin/bash
sudo apt-get update && sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libtheora-dev libtool libvorbis-dev pkg-config texinfo zlib1g-dev
sudo apt-get install -y yasm
mkdir ~/ffmpeg_sources
# Yasm
cd ~/ffmpeg_sources
@djekl
djekl / taybalt.zsh-theme
Created February 18, 2017 20:07
a slightly modified version of taybalt.zsh-theme from here - https://github.com/driesvints/dotfiles/blob/master/taybalt-custom.zsh-theme
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
@djekl
djekl / deriveSP800108HmacSHA256Key.java
Created October 13, 2016 08:07
Does anybody know how to convert this to PHP correctly, and can provide a derived key in java, for comparison in PHP
static byte[] deriveSP800108HmacSHA256Key(final int n, final byte[] array, final String s, final byte[] array2) {
final ByteBuffer allocate = ByteBuffer.allocate(n);
final ByteBuffer allocate2 = ByteBuffer.allocate(4);
final Mac initializedHmacSha256Digester = Cryptography.getInitializedHmacSha256Digester(new SecretKeySpec(array, "HmacSHA256"));
int n2 = 1;
while (allocate.position() < n) {
initializedHmacSha256Digester.reset();
allocate2.clear();
allocate2.putInt(n2);
allocate2.rewind();
@djekl
djekl / compare_postfix_ssha512_hash.php
Last active November 15, 2022 23:47
This is how you generate and compare a Postfix Salted SHA512 Hash in PHP. It assumes you have used an 8bit salt for your hash. Tested here on all PHP versions - https://3v4l.org/8qtW0
<?php
$password = "chemicals1";
$expected = "{SSHA512}w/lHn2LXfNletbfyLVYutBFqUjGPzhmptyleVlehUZSZdylZCt/sDmvkhTBV1Ln4f6rzXTdM6eOGr3LX7FgGCF5/fsbs0vVq";
function generate_postfix_ssha512_hash($password, $salt = false) {
$hash_algo = "{SSHA512}";
$salt_length = 8;
// generate a random salt if one isn't provided
@djekl
djekl / README.md
Created June 28, 2016 10:36 — forked from tashian/README.md
Just-in-time label printing on the Zebra ZP450 using node.js + Easypost + Pusher + cups

This is the script we use at yerdle to print labels from our Rails backend to our Zebra ZP450 printer.

the Zebra

See this blog post for the whole story.

@djekl
djekl / README.md
Created June 28, 2016 10:35 — forked from joyrexus/README.md
Node.js streams demystified

A quick overview of the node.js streams interface with basic examples.

This is based on @brycebaril's presentation, Node.js Streams2 Demystified

Overview

Streams are a first-class construct in Node.js for handling data.

Think of them as as lazy evaluation applied to data.

@djekl
djekl / falsehoods.md
Created April 17, 2016 07:25 — forked from wboykinm/falsehoods.md
Falsehoods programmers believe about addresses - by Michael Tandy

Falsehoods programmers believe about addresses

This is an anchor-linked version of the excellent, amazing original opus magnum by Michael Tandy.

An address will start with, or at least include, a building number.

Counterexample: Royal Opera House, Covent Garden, London, WC2E 9DD, United Kingdom.

When there is a building number, it will be all-numeric.

Counterexample: 1A Egmont Road, Middlesbrough, TS4 2HT

@djekl
djekl / animations.css
Created April 9, 2016 19:21
SVG2CSS : output files
@keyframes dropball {
0% {
bottom: 200px;
}
2% {
bottom: 198.89046144485474px;
left: 2.000002145767212px;
}
4% {
bottom: 197.5577425956726px;
@djekl
djekl / animations.css
Created April 9, 2016 19:21
SVG2CSS : output files
@keyframes dropball {
0% {
bottom: 200px;
}
2% {
bottom: 198.89046144485474px;
left: 2.000002145767212px;
}
4% {
bottom: 197.5577425956726px;
@djekl
djekl / CSS Xbox One Achievement.markdown
Last active May 25, 2026 15:26
CSS Xbox One Achievement

CSS Xbox One Achievement

As an avid Xbox Gamer and always wanting to push myself, I decided to recreate the Xbox One Achievement Toast. ou can see a video example of it here - https://www.youtube.com/watch?v=CgwkK2uUk1c&feature=youtu.be

All I need to do now, is play this to make it complete - (Achievement Notification Sound) http://majornelson.com/2011/10/07/download-the-achievement-unlocked-sound/

Here is an example of the old 360 one - http://codepen.io/jesseGlacken/details/uwtsx/

A Pen by Alan Wynn on CodePen.