See how a minor change to your commit message style can make a difference.
Tip
Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs
#!/bin/bash | |
# Script is needed because my default firewall rules are messed up and after | |
# every restart, docker containers can't make connections to the host, notably | |
# preventing debuggers like xdebug from attaching. | |
# If networking fails in your containers but works in others, rm and re-create the | |
# docker network that container is bound to. | |
set -euo pipefail |
"use strict"; | |
// By Mahmoud Eskandari @ MIT license | |
function validateCard(card) { | |
if (typeof card === 'undefined' | |
|| card === null | |
|| card.length !== 16) { | |
return false; | |
} | |
let cardTotal = 0; | |
for (let i = 0; i < 16; i += 1) { |
See how a minor change to your commit message style can make a difference.
Tip
Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs
package com.luv2code.springdemo; | |
import java.util.logging.ConsoleHandler; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
import java.util.logging.SimpleFormatter; | |
import javax.annotation.PostConstruct; | |
import org.springframework.beans.factory.annotation.Value; |
function iso7064Mod97_10(iban) { | |
var remainder = iban, | |
block; | |
while (remainder.length > 2){ | |
block = remainder.slice(0, 9); | |
remainder = parseInt(block, 10) % 97 + remainder.slice(block.length); | |
} | |
return parseInt(remainder, 10) % 97; |
On my Macbook Pro (OS X El Capitan) I was having issues on Electron based apps. These apps had visual issues/glitches like blank screens, visual components showing only when hovering or transparent menus.
By opening with these comands, the problems disappeared.
open /Applications/Slack.app/ --args --disable-gpu
open /Applications/Trello.app/ --args --disable-gpu
open /Applications/Whatsapp.app/ --args --disable-gpu
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
import { createCipheriv, createDecipheriv, randomBytes } from "crypto"; | |
const ENCRYPTION_KEY: string = process.env.ENCRYPTION_KEY || ""; // Must be 256 bits (32 characters) | |
const IV_LENGTH: number = 16; // For AES, this is always 16 | |
/** | |
* Will generate valid encryption keys for use | |
* Not used in the code below, but generate one and store it in ENV for your own purposes | |
*/ | |
export function keyGen() { |
This is a working example on how to store CryptoKey
s locally in your browser. We are able to save the objects, without serializing them. This means we can keep them not exportable (which might be more secure?? not sure what attack vectors this prevents).
To try out this example, first make sure you are in a browser that has support for async...await
and indexedDB (latest chrome canary with chrome://flags
"Enable Experimental Javascript" works). Load some page and copy and paste this code into the console. Then call encryptDataSaveKey()
. This will create a private/public key pair and encrypted some random data with the private key. Then save both of them. Now reload the page, copy in the code, and run loadKeyDecryptData()
. It will load the keys and encrypted data and decrypt it. You should see the same data logged both times.