Skip to content

Instantly share code, notes, and snippets.

View bobmaerten's full-sized avatar
🏠
Working from home

Bob Maerten bobmaerten

🏠
Working from home
  • Level UP Solutions
  • Valenciennes, France
View GitHub Profile
@0gust1
0gust1 / .bashrc
Created July 24, 2018 12:56
Working behind a corporate proxy - snippet to copy/paste in your shell rc file (or profile)
setProxy(){
export all_proxy=socks://url.to.proxy:80
export http_proxy=http://url.to.proxy:80
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export ALL_PROXY=$all_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export FTP_PROXY=$http_proxy
export no_proxy="localhost, 127.0.0.1, .internal.domain"
@Ch4s3
Ch4s3 / csp_middleware.rb
Created January 30, 2018 05:21
simple rack middleware to set a csp header
module Rack
# Simple rack middleware to
# allow me to use a webworker locally
class CspMiddleware
def initialize(app, options = {})
@app = app
@options = options
end
def call(env)
@tut-tuuut
tut-tuuut / delete-tweets-from-twitarchive.rb
Last active May 17, 2018 20:12
Delete every tweet contained in your tweet archive. Forked from https://gist.github.com/robinsloan/3688616
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = ""
TWITARCHIVE_TWEETS = "/eg/path/to/your/twitarchive/data/js/tweets"
# get these from dev.twitter.com
CONSUMER_KEY = ""
@czj
czj / ydl.sh
Last active September 11, 2018 16:20
Download any YouTube video, channel or playlist using youtube-dl
#!/usr/bin/env bash
# Download a file from a given url
if [ -z "$1" ]; then
echo "Download a video."
echo "Usage: ydl \"url\""
else
youtube-dl --get-filename -o '%(title)s.%(ext)s' --restrict-filenames --yes-playlist --no-mark-watched --all-formats -f 'best[ext=mp4]/best' "$1"
fi
@weikinhuang
weikinhuang / php-js-post-checkout-merge-hook
Last active May 2, 2020 12:41
post-checkout/post-merge hook to automate npm/yarn/bower/composer install only when they change
#!/bin/bash
#
# A hook to update files for package managers
# bin/post-checkout-merge-hook
#
# This is a post-merge/post-checkout/post-rewrite hook.
#
#set -x
if [[ "$SKIP_COM_GIT_HOOK" == '1' ]]; then
@kevinelliott
kevinelliott / 1-macOS-10.12-sierra-setup.md
Last active February 5, 2024 07:22
macOS 10.12 Sierra Setup

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@fuse
fuse / _docker-machine
Created January 28, 2016 10:04
Extend docker-machine to have a use command
#compdef docker-machine
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Docker Machine (http://docs.docker.com/machine/).
# Adapted from boot2docker completion by hhatto (https://github.com/hhatto)
# and docker completion by @aeonazaan and @bobmaerten.
#
# ------------------------------------------------------------------------------
@raybrownco
raybrownco / image_helpers.rb
Last active July 10, 2021 13:37
Inline SVG in Middleman
# Middleman - Inline SVG Helper
# ------------------------------------------------------------------------------
#
# Installation
# ------------
# 1. Save this file at `[project_root]/helpers/image_helpers.rb`
# 2. Open the project's Gemfile and add this line: `gem "oga"`
# 3. Run `bundle install` from the command line
#
# Note: Restart your local Middleman server (if it's running) before continuing
@probablykabari
probablykabari / .bowerrc
Last active August 29, 2015 14:22
Foundation Apps with Rails
{
"directory": "vendor/assets/bower_components"
}
@lewisd32
lewisd32 / iptableflip.sh
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866