Skip to content

Instantly share code, notes, and snippets.

@lsauvaget
lsauvaget / gist:341e541eff6aaa934513
Created June 1, 2015 15:20
Publish-Subscribe Vanilla JS
//Fork of https://github.com/shichuan/javascript-patterns/blob/master/jquery-patterns/pubsub-plugin.html
// No need JQuery
var o = {};
(function(d){
// the topic/subscription hash
var cache = {};
d.publish = function(/* String */topic, /* Array? */args){
cache[topic] && [].forEach.call(cache[topic], function(element){
element.apply(d, args || []);
export PATH="$HOME/.node/bin:$PATH"
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
# Finished adapting your PATH environment variable for use with MacPorts.
#!/bin/bash
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get autoclean -y
apt-get install vim-nox git tmux curl
cd ~
git clone https://github.com/yatmak/vimconfig
mv vimconfig .vim
mv .vim/.vimrc.copy .vimrc
curl -L -Ss https://gist.githubusercontent.com/pmartin/1b35fc2214b9cac8f205/raw/efaa7bbfabc85c2e3c2ca6bd8d678d9765e30d0c/.tmux.conf > ~/.tmux.conf
#!/bin/sh
# Réinitialise les règles
iptables -t filter -F
iptables -t filter -X
# Bloque tout le trafic
iptables -t filter -P INPUT DROP
iptables -t filter -P FORWARD DROP
iptables -t filter -P OUTPUT DROP
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<div id="root"></div>
</head>
<body>