Skip to content

Instantly share code, notes, and snippets.

@yfix
yfix / Howto.md
Created March 27, 2018 14:58 — forked from n1k0/Howto.md
CasperJS test cli hooks example

Put test1.js and test2.js into a tests/ directory, then run the suite:

$ casperjs test tests/ --pre=pre.js --includes=inc.js --post=post.js
Test file: /Users/nperriault/tmp/pre-inc/pre.js                                 
Hey, I'm executed before the suite.
Test file: /Users/nperriault/tmp/pre-inc/tests/test1.js                         
# this is test 1
Hi, I've been included.
PASS Subject is strictly true
@yfix
yfix / docker-compose.yml
Created March 12, 2018 11:44 — forked from gschmutz/docker-compose.yml
Docker Compose with Kafka Single Broker, Connect, Schema-Registry, REST Proxy, Kafka Manager
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:3.3.0
hostname: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
@yfix
yfix / gh-dl-release
Created April 7, 2017 13:48 — forked from maxim/gh-dl-release
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@yfix
yfix / bamboo-to-slack.py
Created August 30, 2016 14:37 — forked from remmelt/bamboo-to-slack.py
Post an Atlassian Bamboo build result to Slack
#!/usr/bin/python
"""
Create a stage in your project, make it the last stage.
Make a task in the stage with this inline script:
#! /bin/bash
/some/path/bamboo-to-slack.py "${bamboo.planKey}" "${bamboo.buildPlanName}" "${bamboo.buildResultsUrl}"
@yfix
yfix / autoreload_supervisor.sh
Created August 24, 2016 10:38 — forked from DerMitch/autoreload_supervisor.sh
auto-reload supervisord config on changes
#!/bin/sh
# auto-reload supervisor config on a config file change
# Licensed under Public Domain
# apt-get install inotify-tools
while true; do
inotifywait --quiet --recursive --event create,close_write /etc/supervisor/
supervisorctl reread
supervisorctl update
@yfix
yfix / node-and-npm-in-30-seconds.sh
Created June 3, 2016 12:58 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@yfix
yfix / tmux-cheatsheet.markdown
Created May 23, 2016 12:05 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@yfix
yfix / index.js
Created April 19, 2016 13:08 — forked from cait08/gist:72d4c0c254ce5869cb99
checkboxes mass select with shift key
// Usage: $form.find('input[type="checkbox"]').shiftSelectable();
// replace input[type="checkbox"] with the selector to match your list of checkboxes
$.fn.shiftSelectable = function() {
var lastChecked,
$boxes = this;
$boxes.click(function(evt) {
if(!lastChecked) {
lastChecked = this;
@yfix
yfix / stuns
Created April 5, 2016 09:42 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@yfix
yfix / Install PhantomJS, CasperJS and dependencies.
Created March 28, 2016 10:15 — forked from navio/Install PhantomJS, CasperJS and dependencies.
Script to install NVM, Node, PhantomJS and CasperJS without installing or using git.
#!/bin/bash
# Sets node version to install.
export NODE_VERSION=v0.10.21;
# Verify if nvm installation exist, otherwise install.
if ! hash "nvm" >/dev/null 2>&1; then
printf "Installing NVM %s\n" >&2