Skip to content

Instantly share code, notes, and snippets.


Alexandru Vlăduţu alessioalex

View GitHub Profile
darvell / add_node_exceptions.ps1
Created Oct 23, 2017
Adds useful exceptions to Windows Defender for node.js developers.
View add_node_exceptions.ps1
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator"))
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!"
Write-Host "Excluding appdata NPM folder and Node.JS install folder from Windows Defender."
Add-MpPreference -ExclusionPath ([System.Environment]::ExpandEnvironmentVariables("%APPDATA%\npm\"))
Add-MpPreference -ExclusionPath (Get-ItemProperty "HKLM:SOFTWARE\Node.js" | Select-Object -Property InstallPath)
View Headless Setup of Raspberry Pi Zero W (Raspberry Pi 3 Wireless) (macOS).markdown

#Headless Setup of Raspberry Pi Zero W (Raspberry Pi 3 Wireless) (macOS)

  1. Formatt the Micro SD card - Open a terminal and type 'diskutil list'. Find your card and copy the disk name (For example: /dev/disk4). Format the card with diskutil eraseDisk ExFat temp disk4(Use your disk here)
  2. Download Raspbian - wget
  3. Unmount the SD card - diskutil unmountDisk /dev/disk4 or whatever your disk path is
  4. Mount the Raspbian image to the card - sudo dd if=PATH-TO-RASPBIAN-IMAGE of=/dev/disk4` or whatever your disk path is
  5. Enable SSH on the Pi - cd /volumes && ls. You should see a boot partition from the SD card cd boot && touch ssh
  6. Setup WiFi on the PI - While still in the boot partition of the card type nano wpa_supplicant.conf and enter network={ ssid="YOUR-SSID" psk="YOUR-WIFI-PASSWORD" }
  7. Boot the PI - Unmount the card diskutil unmountDisk /dev/disk4 (or whatever your disk path is) and put it in the
View gz.js
'use strict'
const fs = require('fs')
const path = require('path')
const zlib = require('zlib')
require.extensions['.gz'] =
require.extensions['.js.gz'] = (module, filename) => {
if (path.extname(filename.slice(0, -3)) === '.js') {
let content = zlib.unzipSync(fs.readFileSync(filename)).toString()
developit / async-examples.js
Last active Feb 19, 2020
Async Array utilities in async/await. Now available as an npm package:
View async-examples.js
/** Async version of Array.prototype.reduce()
* await reduce(['/foo', '/bar', '/baz'], async (acc, v) => {
* acc[v] = await (await fetch(v)).json();
* return acc;
* }, {});
export async function reduce(arr, fn, val, pure) {
for (let i=0; i<arr.length; i++) {
let v = await fn(val, arr[i], i, arr);
if (pure!==false) val = v;
huytd / co-in-15-lines.js
Last active May 25, 2016
Re-implement tj/co in 15 lines
View co-in-15-lines.js
function run(fn) {
var pointer = fn();
var next = function(result) {
if (result.value.then && typeof result.value.then === 'function') {
result.value.then(function(data) {
var out =;
if (!out.done) next(out);
} else {
var out =;
btroncone /
Last active Oct 20, 2020
RxJS 5 Operators By Example
btroncone /
Last active Oct 23, 2020
A Comprehensive Introduction to @ngrx/store - Companion to Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents


Challenges in using postmortem debugging with promises


This document seeks to summarize recent discussions about postmortem debugging, promises, and using them together. It starts by presenting what post-mortem debugging use cases are impacted negatively by the usage of promises. Then it describes some potential solutions that have been tried to fix these issues and their shortcomings.

vasanthk / System
Last active Oct 24, 2020
System Design Cheatsheet
View System

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
oleq /
Last active Sep 20, 2020
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
 (((  Wireless Bluetooth Channel  )))
You can’t perform that action at this time.