Skip to content

Instantly share code, notes, and snippets.

🥁
Breaking things to improve them

Jimmie Hansson jimmiehansson

🥁
Breaking things to improve them
Block or report user

Report or block jimmiehansson

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 middleware
(function() {
var AfterMethods, BeforeMethods, Middlewares, formatJsonWithPrefixAndColor, logAfterExecution, logBeforeExecution, processResult, removeInternalProperties, utils,
__slice = [].slice;
utils = Npm.require('util');
Middlewares = {};
BeforeMethods = {};
View keybase.md

Keybase proof

I hereby claim:

  • I am jimmiehansson on github.
  • I am a610 (https://keybase.io/a610) on keybase.
  • I have a public key ASCewARCwMmxLOoNu7Ewc0xMqIv0XnaHlu5TWEaf6DK4tQo

To claim this, I am signing this object:

View jwt.js
{
"type": "object",
"$schema": "[http://json-schema.org/draft-07/schema#](http://json-schema.org/draft-07/schema#)",
"properties": {
"iat": {
"title": "Issued at time",
"type": "string",
"description": "The issued at time.",
"maxLength": 20
},
View gist:5ede51beb94e07da925450a4a2053cce
### Keybase proof
I hereby claim:
* I am jimmiehansson on github.
* I am jimmiehansson (https://keybase.io/jimmiehansson) on keybase.
* I have a public key ASD7KCBcwKD7PgEIyr8uNSUC7FfEuQYQajIU2AI9-xBBmgo
To claim this, I am signing this object:
View lru.js
/**
* @description
*
* DOING: Should node modules and files required
* to separate them from the rest.
*/
const Sequelize = require('sequelize');
const SequelizeAutoBin = 'node_modules/sequelize-auto/bin/sequelize-auto';
const Joi = require('joi');
View kubernetes-as-proxmox-container.md

Add to your contaier config /etc/pve/lxc/XXX.conf:

lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop: 
lxc.mount.auto: proc:rw sys:rw

View benchmark.js
const Benchmark = require('benchmark')
const xxhash = require('xxhash')
const siphash = require('siphash')
const fnv1a = require('@sindresorhus/fnv1a')
const { createHash } = require('crypto')
var suite = new Benchmark.Suite
const config_ = {
SECRET: 'This is a secret key',
@jimmiehansson
jimmiehansson / index.js
Created Jul 4, 2019
Etag non secure hash
View index.js
'use strict'
const fp = require('fastify-plugin')
function hash (A) {
if (!A) return void 0
var bin_
var buf_
var b64_
@jimmiehansson
jimmiehansson / index.js
Created Jul 4, 2019
Etag rand without added seed and less collision
View index.js
'use strict'
const fp = require('fastify-plugin')
function hash (timestamp) {
if (!timestamp) return void 0
var buf_
var b64_
View ignore.js
// quick example
function expectedLogSuffix (expression = { str: '', encounters: 2 }) {
var { str, encounters } = expression
if (str === null || str.length === 0 || typeof str !== 'string') {
return undefined
}
var trim = str.split(' ').filter(n => n.match(/^[A-Z]{4}s*/))
return trim.length === encounters
}
You can’t perform that action at this time.