Skip to content

Instantly share code, notes, and snippets.

In the zone

Alain Perkaz aperkaz

In the zone
View GitHub Profile
aperkaz / asyncForEach.ts
Created August 24, 2022 09:27
🔁 asyncForEach utility in TS
View asyncForEach.ts
async function asyncForEach<T>(
array: T[],
callback: (el: T, index: number, array: T[]) => Promise<void>
) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
aperkaz /
Last active August 5, 2020 12:21
DynamoDB Introduction and key concepts

Introduction to DynamoDB

NoSQL databased, by AWS. Key-value store.

deep dive video

Key features

  • Fully managed. Autoscaling, partitioning...
  • Key-value store. NoSQL DB, but relational (all data stored in a DB is relational!)
aperkaz /
Last active August 3, 2020 16:27
Terraform Introduction


Infrastructure as a code technology. Helps you manage your backend infrastructure on 3rd party services like amazon with configurations.

This gist is a short introduction to the basics of Terraform.

Main concepts

Terraform uses its own language to define how your backend should look like, and it figues out automatically how to spin it yup in an efficient manner, using a dependency graph between components.

aperkaz / index.js
Created June 23, 2020 10:03
Get host lat-long in electron.js
View index.js
(async () => {
const got = require("got");
const publicIp = require("public-ip");
// get public ip
const publicIpV4 = await publicIp.v4();
// get location from ip
try {
const response = await got(`${publicIpV4}`);
aperkaz / Functional JS binary search.js
Last active April 30, 2019 07:31
Code kata 1 - CodeHub
View Functional JS binary search.js
const INVALID = -1;
const binarySearch = (target, arr) => {
const start = 0;
const finish = arr.length - 1;
const middle = Math.floor((start + finish) / 2);
console.log('middle value: ',arr[middle]);
aperkaz / ergodox_ez_test-layout-7_yeyJ.hex
Created April 15, 2019 12:36
Ergodox-ez configuration
View ergodox_ez_test-layout-7_yeyJ.hex
aperkaz / settings.json
Created March 14, 2019 14:36
VS configuration
View settings.json
"window.title": "${dirty} ${activeEditorMedium}${separator}${rootName}",
"editor.formatOnPaste": true,
"editor.fontFamily": "Operator Mono",
"terminal.integrated.fontFamily": "Fira Code",
"terminal.integrated.fontSize": 14,
"terminal.integrated.lineHeight": 1.5,
"editor.fontSize": 18,
"editor.renderWhitespace": "boundary",
"editor.autoIndent": true,
aperkaz /
Last active June 15, 2018 23:48
Linux scaling

Linux Scaling

Force scaling of applications when in HiDPI screens.

Add to the command, X being the scale factor:


Example, execute Spotify with 2x scaling:

aperkaz /
Created June 15, 2018 14:15
Linux Backup


Save to file

dconf dump /org/gnome/desktop/wm/keybindings/ > keybindings.dconf

Load from file

dconf load /org/gnome/desktop/wm/keybindings/ &lt; keybindings.dconf
aperkaz / .config__redshift.conf
Created May 29, 2018 13:24
Redshift config
View .config__redshift.conf
; Global settings for redshift
; Set the day and night screen temperatures
; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature.