Skip to content

Instantly share code, notes, and snippets.

@dotcomputercraft
dotcomputercraft / An Overview
Last active October 29, 2018 17:29
An Overview
The following adapter is inspired by mattiwintou adapter from Rx Observable to F.Promise
https://gist.github.com/matiwinnetou/7b69253acaad996747c4
GIT STRATEGY WIKI
to create a new feature branch:
git fetch --all // gets all the latest from remote
git checkout -b <feature-branch-name> origin/master // creates and checks out new branch tracking origin/master
to develop on your feature branch:
git checkout <feature-branch-name>
git pull --rebase origin <feature-branch-name> // makes sure you are working with the latest code from the feature branch
@dotcomputercraft
dotcomputercraft / gist:0947eb7ed6b3b5cc14b6
Created November 5, 2015 15:24
increase max number of ulimit open file and max user processes in Linux.
1- Step : open the sysctl.conf and add this line fs.file-max = 65536
vi /etc/sysctl.conf add end of line
fs.file-max=500000
save and exit.
2. Step : vi /etc/security/limits.conf and add below the mentioned
* soft nproc 500000
# What is a javascript closure
It’s my explanation of what closures are from a JavaScript perspective
### Step 1: How can you create a closure?
### Short answer:
A closure is an inner function that has access to variables from outer scopes because they store references of its variables. This is possible because each closure stores the code within its scope. Let’s see how to create one in an example.
1. The variable x has created a closure.
1. The inner function has access to the outer functions variables. This is also a great example of currying.
@dotcomputercraft
dotcomputercraft / gist:b7283bd52f4b5389e748
Last active November 4, 2023 13:05
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
the best way (I've found) to completely uninstall node + npm is to do the following:
go to /usr/local/lib and delete any node and node_modules
go to /usr/local/include and delete any node and node_modules directory
if you installed with brew install node, then run brew uninstall node in your terminal
check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
go to /usr/local/bin and delete any node executable
You may need to do the additional instructions as well:
sudo rm /usr/local/bin/npm
zipstream = require "zipstream"
fs = require "fs"
async = require "async"
class StreamingResponse
filename: ""
files: []
streaming: true
###