Skip to content

Instantly share code, notes, and snippets.

View aichholzer's full-sized avatar
🚴‍♂️
Improving...

Stefan Aichholzer aichholzer

🚴‍♂️
Improving...
  • AWS
  • Australia
  • 19:25 (UTC +10:00)
View GitHub Profile
@aichholzer
aichholzer / for.js
Last active July 14, 2023 21:37
Validación de cédulas y similares (Algoritmo de Luhn)
const ced = '0931811087';
let [suma, mul, chars] = [0, 1, ced.length];
for (let index = 0; index < chars; index += 1) {
let num = ced[index] * mul;
suma += num - (num > 9) * 9;
mul = 1 << index % 2;
}
if ((suma % 10 === 0) && (suma > 0)) {
@aichholzer
aichholzer / int2ip.js
Created July 7, 2020 04:01 — forked from jppommet/int2ip.js
javascript conversion from ip address to long integer and vice versa
function int2ip (ipInt) {
return ( (ipInt>>>24) +'.' + (ipInt>>16 & 255) +'.' + (ipInt>>8 & 255) +'.' + (ipInt & 255) );
}
@aichholzer
aichholzer / copydyn.js
Last active July 20, 2020 00:33
Copy data from one DynamoDB table to another.
#!/usr/bin/env node
/* eslint no-console: 0 */
const AWS = require('aws-sdk');
AWS.config.update({ region: 'ap-southeast-2' });
const db = new AWS.DynamoDB.DocumentClient();
const [, , from, to] = [...process.argv];
if (!from || !to) {
console.error('\n 💥 The "from" and "to" arguments are required.');
@aichholzer
aichholzer / curl.md
Created November 4, 2021 01:48 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

Keybase proof

I hereby claim:

  • I am aichholzer on github.
  • I am safetrip (https://keybase.io/safetrip) on keybase.
  • I have a public key ASAe8kSBgNpTrhWMn91T-IVFUb10kS1rJ6G_K11Rl9EGRgo

To claim this, I am signing this object: