Skip to content

Instantly share code, notes, and snippets.

@jtbonhomme
jtbonhomme / Remote API via daemon.json.md
Created January 24, 2019 18:00 — forked from kekru/Remote API via daemon.json.md
Enable Docker Remote API via daemon.json

Awless template to start/stop a list of instances

@jtbonhomme
jtbonhomme / git-origins.md
Created October 29, 2018 10:55 — forked from benschw/git-origins.md
fork a repo manually (set source as upstream origin) rather than with the "fork" button. e.g. for in github when you want to fork a project twice.

Ripped off from adrianshort.org

List curent remotes

$ git remote -v

origin  https://github.com/hakimel/reveal.js.git (fetch)
origin  https://github.com/hakimel/reveal.js.git (push)

Rename origin to upstream and add our new empty repo as the origin.

@jtbonhomme
jtbonhomme / deployment_to_gitlab_pages.md
Created October 14, 2018 18:03 — forked from shyiko/deployment_to_gitlab_pages.md
Deploying to GitLab Pages (on each push)

(assuming project is hosted on GitLab)

  1. Enable shared runners by going to "Settings" > "Runners".
  2. Add .gitlab-ci.yml with the following content:
image: node:6.9.1
pages: 
  artifacts: 
paths: 
@jtbonhomme
jtbonhomme / openssl_commands.md
Created April 5, 2018 09:36 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

openssl

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@jtbonhomme
jtbonhomme / example.go
Created March 13, 2018 15:47 — forked from ciaranarcher/example.go
Wrapping a ResponseWriter to capture the status code
// Create our own MyResponseWriter to wrap a standard http.ResponseWriter
// so we can store the status code.
type MyResponseWriter struct {
status int
http.ResponseWriter
}
func NewMyResponseWriter(res http.ResponseWriter) *MyResponseWriter {
// Default the status code to 200
return &MyResponseWriter{200, res}
@jtbonhomme
jtbonhomme / bluetooth.sh
Created January 28, 2018 07:11 — forked from jnovack/bluetooth.sh
Control Bluetooth Daemon through Command Line OSX
#read the current pref, returns '0' for off and '1' for on.
defaults read /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState
#set bluetooth pref to off
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0
#set bluetooth pref to on
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 1
#kill the bluetooth server process
@jtbonhomme
jtbonhomme / README.md
Created September 28, 2017 19:45 — forked from SamyPesse/README.md
Complete example of code highlight for Draft.js with Prism

How to test it?

Copy the prism.js file under examples/prism/ in Draft.js repository. Run npm install prismjs Then open it in your browser.

@jtbonhomme
jtbonhomme / rest.py
Created June 3, 2017 13:08 — forked from tliron/rest.py
Simple and functional REST server for Python (2.7) using no dependencies beyond the Python standard library.
#!/usr/bin/env python
'''
Simple and functional REST server for Python (2.7) using no dependencies beyond the Python standard library.
Features:
* Map URI patterns using regular expressions
* Map any/all the HTTP VERBS (GET, PUT, DELETE, POST)
* All responses and payloads are converted to/from JSON for you
@jtbonhomme
jtbonhomme / bobp-python.md
Created April 16, 2017 12:52 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens