Skip to content

Instantly share code, notes, and snippets.

View joshua-chavanne's full-sized avatar
:octocat:
Git'n stuff done

joshua chavanne joshua-chavanne

:octocat:
Git'n stuff done
  • laudable info
  • oakland, ca
View GitHub Profile
@joshua-chavanne
joshua-chavanne / zmv_underscores.sh
Created January 25, 2017 19:14
zmv files with spaces to underscores
zmv '* *' '$f:gs/ /_'
@joshua-chavanne
joshua-chavanne / gist:a466c69bee651b8cf3f0c8c980475086
Created January 19, 2017 23:24 — forked from grandmanitou/gist:8863248
Place multiple markers with infowindow on Google Maps API v3, use external links to trigger click and center map on desired location.
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?language=fra&amp;sensor=false"></script>
<script type="text/javascript">
var map;
var Markers = {};
var infowindow;
var locations = [
[
'Samsung Store Madeleine',
'<strong>Samsung Store Madeleine</strong><p>5 Boulevard Malesherbes, 75008 Paris<br>10h – 20h</p>',
48.8701925,
@joshua-chavanne
joshua-chavanne / pandocDocx.sh
Last active January 13, 2017 19:27
Pandoc a Directory of Docxs
# Single output files
for f in *.docx ; do pandoc ${f} -f docx -t html -s -o ${f}.html ; done
@joshua-chavanne
joshua-chavanne / retain.conf
Created August 31, 2016 18:14
Nginx retain query!
location /some/location {
# check, if any query strings are available
if( $args = '' ) {
# no query found, so...
return 301 /destination/url/;
}
# if it reaches here, then query is found, so...
return 301 /destination/url/?$args;
}
@joshua-chavanne
joshua-chavanne / with-posts-wordpress-function.php
Created May 9, 2016 18:50 — forked from bonny/with-posts-wordpress-function.php
WordPress function with_posts(), that simplifies getting and looping posts, in a jQuery anonymous function-ish way. Setups global, restores post afterwards. Simple, flexible and powerful.
<?php
/**
* WordPress WP_QUERY-wrapper to simplify getting and working with posts
*
* Does something with posts, using a callback
* Setups global post variable before running callback
* And restores it afterwards
*
* An introductionary blogpost about this function is posted on our blog:

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@joshua-chavanne
joshua-chavanne / .bash_profile
Created February 7, 2016 15:59 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@joshua-chavanne
joshua-chavanne / Data
Last active January 1, 2016 22:47
Things I like in dev environments
* jq (command-line json parser and exporter)
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
# wordpress specific
wp-config.php
@joshua-chavanne
joshua-chavanne / get_barcode_from_image.js
Created December 8, 2015 23:40 — forked from tbtlr/get_barcode_from_image.js
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',