Skip to content

Instantly share code, notes, and snippets.

View aperkaz's full-sized avatar
🚀
In the zone

Alain Perkaz aperkaz

🚀
In the zone
View GitHub Profile
@aperkaz
aperkaz / asyncForEach.ts
Created August 24, 2022 09:27
🔁 asyncForEach utility in 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
aperkaz / DynamoDB.md
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
aperkaz / terraform-intro.md
Last active August 3, 2020 16:27
Terraform Introduction

Terraform

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
aperkaz / index.js
Created June 23, 2020 10:03
Get host lat-long in electron.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(`http://ip-api.com/json/${publicIpV4}`);
@aperkaz
aperkaz / Functional JS binary search.js
Last active April 30, 2019 07:31
Code kata 1 - CodeHub
const INVALID = -1;
const binarySearch = (target, arr) => {
const start = 0;
const finish = arr.length - 1;
const middle = Math.floor((start + finish) / 2);
console.log(arr);
console.log('middle value: ',arr[middle]);
@aperkaz
aperkaz / ergodox_ez_test-layout-7_yeyJ.hex
Created April 15, 2019 12:36
Ergodox-ez configuration
:100000000C94C3030C94E0030C94E0030C94E00301
:100010000C94E0030C94E0030C94E0030C94E003D4
:100020000C94E0030C94E0030C942C2B0C94FE2B0A
:100030000C9492230C94E0030C94E0030C94E003E2
:100040000C94E0030C94E0030C94E0030C94E003A4
:100050000C94E0030C94FA230C94E0030C94E0035A
:100060000C94E0030C94E0030C94E0030C94E00384
:100070000C94E0030C94E0030C94E0030C94E00374
:100080000C94E0030C94E0030C94E0030C94E00364
:100090000C94E0030C94E0030C94E0030C94E00354
@aperkaz
aperkaz / settings.json
Created March 14, 2019 14:36
VS configuration
{
"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
aperkaz / linux-scaling.md
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:

--force-device-scale-factor=X

Example, execute Spotify with 2x scaling:

@aperkaz
aperkaz / backup.md
Created June 15, 2018 14:15
Linux Backup

Hotkeys

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
aperkaz / .config__redshift.conf
Created May 29, 2018 13:24
Redshift config
; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5300
temp-night=3500
; 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.
transition=1