Skip to content

Instantly share code, notes, and snippets.

Lukas Siemon simlu

Block or report user

Report or block simlu

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
View gist:2f9ebc4cf24e6ceb90fb578a291b3a9c
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
public class T {
private final static char[] hexArray = "0123456789ABCDEF".toCharArray();
private static String bytesToHex(byte[] bytes) {
@simlu
simlu / make-files-unique.js
Created Aug 22, 2018
Make files unique, ignoring different string / number value in object hierarchy
View make-files-unique.js
const fs = require("fs");
const path = require("path");
const get = require("lodash.get");
const set = require("lodash.set");
const objectScan = require("object-scan");
const objectHash = require("object-hash");
const data = Object.entries(fs.readdirSync(path.join(__dirname, "query"))
.map(f => f.slice(0, -5))
.reduce((p, f) => Object.assign(p, {
@simlu
simlu / npm-offline-cache.js
Last active Jul 1, 2018
NPM Offline Cache Experiment
View npm-offline-cache.js
// Unfortunately this doesn't work as expected (NPM is broken as usual)
const os = require("os");
const fs = require("fs");
const path = require("path");
const { execSync, exec } = require('child_process');
const async = require("async");
const objectScan = require("object-scan");
const get = require("lodash.get");
const difference = require("lodash.difference");
View gist:6735d181f0e79a1c87ba32a32620ba77
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudformation:Describe*",
"cloudformation:List*",
"cloudformation:Get*",
"cloudformation:PreviewStackUpdate",
View gist:945b3073a15a378eaa00f2ac9becd016
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudformation:Describe*",
"cloudformation:List*",
"cloudformation:Get*",
"cloudformation:PreviewStackUpdate",
You can’t perform that action at this time.