Skip to content

Instantly share code, notes, and snippets.

View manekinekko's full-sized avatar
:octocat:
Check me out on Twitter @manekinekko

Wassim Chegham manekinekko

:octocat:
Check me out on Twitter @manekinekko
View GitHub Profile
@manekinekko
manekinekko / index.spec.ts
Created April 21, 2024 13:11
Mocking node:child_process.spawn() using Jest + TypeScript
import { Readable } from "stream";
const mockSpawn = jest.fn(() => {
return {
stdout: new Readable({
read() {
this.push("stout data"); // write mock data to stdout
this.push(null); // end stream
},
}),
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@manekinekko
manekinekko / digital-covid-certificate-fr-decoder.txt
Last active July 21, 2021 10:14
An attempt to decode the Digital Covid Certificate (signed with the FR public key - Tous Anti Covid) - For Educational Purposes Only
Code was moved to https://github.com/manekinekko/digital-covid-certificate-decoder
@manekinekko
manekinekko / swa-arm.json
Created April 14, 2021 08:45
Sample SWA deployment template
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "string"
},
"location": {
"type": "string"
},
@manekinekko
manekinekko / zonejs-flags.ts
Created February 3, 2021 09:37
Reduce overhead introduced by the Zone.js
// Reduce overhead introduced by the Zone.js:
// by Wassim Chegham (@manekinekko)
// Instructions:
// 1. Add this config in a different file, eg. zone-flags.ts
// 2. make sure to check that your app is not relying on an API before disabling it!!!
// 3. import ./zone-flags.ts in polyfills.ts
// Not needed for morst of Angular apps
(window as any).__Zone_disable_requestAnimationFrame = true;
# Popular Ultrsonic Transmission Protocols (freq. in Hz)
# Wassim Chegham (@manekinekko)
# License: Attribution 4.0 International
Lisnr = 18750,18895,19051,19196,19509
Silverpush = 18000,18075,18150,18225,18300,18375,18450,18525,18600,18675,18750,18825,18900,18975,19050,19125,19200,19275,19350,19425,19500,19575,19650,19725,19800,19875,19950
Google Nearby = 18500,18524,18548,18571,18595,18619,18643,18667,18690,18714,18738,18762,18786,18810,18833,18857,18881,18905,18929,18952,18976,19000,19024,19048,19071,19095,19119,19143,19167,19190,19214,19238,19262,19286,19310,19333,19357,19381,19405,19429,19452,19476,19500,19524,19548,19571,19595,19619,19643,19667,19690,19714,19738,19762,19786,19810,19833,19857,19881,19905,19929,19952,19976,20000
Sonictalk = 16134,16700,17973,18000,18500,18800,19000,19505
Prontoly = 16968,17054,17138,17226,17312,17398,17488,17571,17927,18432,18697,18776,18949,19035,19056,19379,19466,19724
Shopkick = 19960,20040,20120,20200,20280,20360,20440,20520,20600,20680,20760,20840,20920,21000,21080,
#!/usr/bin/env bash
nvm_install_script=https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh
NVM_DIR="$HOME/.nvm"
NVM_NODE_VERSION=14
if [ ! -d "$HOME/.nvm" ]; then
echo "> Downloading NVM..."
curl -s -o- $nvm_install_script | bash >/dev/null 2>&1
export NVM_DIR=$NVM_DIR
#!/bin/ash
# set the input pin
IN_PIN=19
WEBHOOK=https://my-awesome-endpoint.dev/build-id
LOCK_FILE=/tmp/yolo.lock
# set the state direction of the pin
fast-gpio set-input $IN_PIN
@manekinekko
manekinekko / dotfiles.md
Last active February 24, 2020 10:30
My dotfile configurations (in one single file)

Custom Aliases

# Easier navigation: .., ..., ~ and -
alias ..="cd .."
alias cd..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
'use strict';
const fetch = require('node-fetch');
const functions = require('firebase-functions');
const { smarthome } = require('actions-on-google');
const util = require('util');
const admin = require('firebase-admin');
admin.initializeApp();
const firebaseRef = admin.database().ref('/');