Skip to content

Instantly share code, notes, and snippets.

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

Stefan Aichholzer aichholzer

🚴‍♂️
Improving...
  • Same as you...
View GitHub Profile
@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.

@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)) {
service: my-api-gateway
provider:
name: aws
runtime: nodejs6.10
region: sa-east-1
stage: v1
deploymentBucket: ${env:DEPLOYMENT_BUCKET}
iamRoleStatements:
- Effect: Allow
@shortjared
shortjared / list.txt
Last active May 20, 2024 07:26
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@aichholzer
aichholzer / jquery.animator.js
Last active November 9, 2017 03:31
Element animator for jQuery
/**
* Element fadeIn plugin for jQuery.
* @author Stefan Aichholzer <https://github.com/aichholzer>
* @param options -Object defining the animation's end result.
*
* {
* opacity: 1,
* marginBottom: 5,
* duration: 50
* }
@rjz
rjz / crypto-aes-256-gcm-demo.js
Last active March 11, 2024 20:11
example using node.js crypto API with aes-256-gcm
const buffer = require('buffer');
const crypto = require('crypto');
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib.
const aes256gcm = (key) => {
const ALGO = 'aes-256-gcm';
// encrypt returns base64-encoded ciphertext
const encrypt = (str) => {
// The `iv` for a given key must be globally unique to prevent
@croxton
croxton / SSL-certs-OSX.md
Last active March 3, 2024 18:58 — forked from leevigraham/Generate ssl certificates with Subject Alt Names on OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@andreibosco
andreibosco / creative-cloud-disable.md
Last active January 3, 2024 02:37
disable creative cloud startup on mac
@raytung
raytung / spike.js
Last active January 4, 2023 09:31
AWS KMS NodeJS
/*
* AWS Sdk KMS spike: (assuming node v6.6+)
* 1 - Create master key at KMS
* 2 - Copy alias or ARN
* 3 - run this i.e.
* $ node spike.js KEY_ALIAS YOUR_PLAINTEXT_TO_ENCRYPT
*/
const AWS = require('aws-sdk');
// aws-sdk is not reading my region info so i'll have to set it here
@telekosmos
telekosmos / uniq.js
Last active November 15, 2022 17:13
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});