Skip to content

Instantly share code, notes, and snippets.

View despairblue's full-sized avatar
🍸
I always let my imagination run away from me! Then it comes back..... with cake!

Danny Martini despairblue

🍸
I always let my imagination run away from me! Then it comes back..... with cake!
View GitHub Profile
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 23, 2024 19:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@lukewpatterson
lukewpatterson / gist:4242707
Created December 9, 2012 00:24
squeezing private SSH key into .travis.yml file
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
@nikmartin
nikmartin / A: Secure Sessions Howto
Last active July 2, 2024 05:59
Secure sessions with Node.js, Express.js, and NginX as an SSL Proxy
Secure sessions are easy, but not very well documented.
Here's a recipe for secure sessions in Node.js when NginX is used as an SSL proxy:
The desired configuration for using NginX as an SSL proxy is to offload SSL processing
and to put a hardened web server in front of your Node.js application, like:
[NODE.JS APP] <- HTTP -> [NginX] <- HTTPS -> [PUBLIC INTERNET] <-> [CLIENT]
Edit for express 4.X and >: Express no longer uses Connect as its middleware framework, it implements its own now.
@n1mmy
n1mmy / exhibit1
Last active December 22, 2015 12:19
logs for various mongo issues
Exhibit 1: two different primary handoffs. Only the '[rs*]' logs.
Thu Aug 8 14:30:32.395 [rsHealthPoll] DBClientCursor::init call() failed
Thu Aug 8 14:30:32.395 [rsHealthPoll] replSet info production-db-a3.meteor.io:27017 is down (or slow to respond): DBClientBase::findN: transport error: production-db-a3.meteor.i
o:27017 ns: local.$cmd query: { authenticate: 1, nonce: "dffead39ddc33b3d", user: "__system", key: "68664b9158f9708b8f5531498803cc1b" }
Thu Aug 8 14:30:32.395 [rsHealthPoll] replSet member production-db-a3.meteor.io:27017 is now in state DOWN
Thu Aug 8 14:30:32.397 [rsMgr] replSet info electSelf 4
Thu Aug 8 14:30:32.399 [rsBackgroundSync] Socket recv() timeout 54.235.126.126:27017
Thu Aug 8 14:30:32.399 [rsSyncNotifier] Socket recv() timeout 54.235.126.126:27017
Thu Aug 8 14:30:32.399 [rsBackgroundSync] SocketException: remote: 54.235.126.126:27017 error: 9001 socket exception [3] server [54.235.126.126:27017]

Virtual DOM and diffing algorithm

There was a [great article][1] about how react implements it's virtual DOM. There are some really interesting ideas in there but they are deeply buried in the implementation of the React framework.

However, it's possible to implement just the virtual DOM and diff algorithm on it's own as a set of independent modules.

MDB is unlike most debuggers you've experienced.

It is not a source level debugger like gdb or lldb or even Node's builtin debugger

Generally used for postmortem analysis.

Postmortem is for Production and Development

We operate mostly on core files, though you can attach to running processes as well.

@noteed
noteed / docker-tinc.md
Last active April 17, 2019 06:22
Docker - Tinc setup
@torgeir
torgeir / profile-proxy.js
Last active August 29, 2015 14:02
es6 proxy profile method example
function profile (o) {
for (var key in o) {
var field = o[key];
if (typeof field == 'function') {
o[key] = Proxy.createFunction({},
// call
function () {
var before = new Date;
var res = field.apply(o, arguments);
var spent = new Date - before;
@3rd-Eden
3rd-Eden / README.md
Last active January 4, 2021 10:20
Protecting against POODLE in node.js

[Google recently announced][poodle] that there is an exploit in SSLv3, this vulnerability is know as POODLE. There is no other option than to disable SSLv3 in order to combat this major flaw. There have already been [guides on how to disable this in different servers][guides]. But nothing excised for Node.js yet, until now. In order to resolve this for Node.js we need to use various of undocumented options and modules.

In the index.js file below you can see an example of how you can protect your HTTPS server against the POODLE attack. It uses the secureOptions option to pass in constants in to the SSL context which is created by node.