Skip to content

Instantly share code, notes, and snippets.

View edouard-lopez's full-sized avatar
🏠
Working from home

Édouard Lopez edouard-lopez

🏠
Working from home
View GitHub Profile
@edouard-lopez
edouard-lopez / gist:0890b17b53e19fcfefea
Last active February 12, 2016 23:36
proxying from host to guest machine
# blog.site.com
<VirtualHost *:80>
ServerName blog.site.com
ServerAlias blog.site.com wiki.site.com redmine.site.com git.site.com
#ProxyPassMatch ^(blog|git|redmine|wiki).site.com http://$1.site.com/
#ProxyPass / http://blog.site.com/
ProxyPass /blog/ http://blog.site.com/
#ProxyPass /git http://git.site.com/
#ProxyPass redmine.site.com http://redmine.site.com/
@edouard-lopez
edouard-lopez / pywikibot.md
Created May 26, 2013 10:21
Installation du script python wikimedia pour éditer wikidata

Download

Create a bot account

on the account creation page on your wiki or another one (account are available on all wikis).

Run

python pwb.py login -all

and answer question as follow :

@edouard-lopez
edouard-lopez / wiki.json
Created May 26, 2013 15:21
Wiki cheatsheet
{
"metadata": {
"name": "Wikipedia Syntax Cheatsheet",
"description": "Kickstarter for new Wikipedians",
"level": 1,
"authors": [
"Édouard Lopez"
],
"tags": [
"wikipedia",
@edouard-lopez
edouard-lopez / main.js
Created May 27, 2013 08:26
Fetch JSON data for each <div class="cheatsheet" data-json="data/wiki.json"></div> element
var $, Handlebars; // sublime-text-2
$(document).ready(function () {
'use strict';
var jxhr = [];
var csData = [];
var sheetList = $('.cheatsheet');
sheetList.each(function () {
@edouard-lopez
edouard-lopez / grunt.js
Created June 10, 2013 18:27
Running "php:dist" (php) task chdir(): No such file or directory Fatal error: spawn ENOENT
// Generated on 2013-05-09 using generator-webapp 0.1.7
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// Generated on 2013-05-19 using generator-webapp 0.1.7
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
@edouard-lopez
edouard-lopez / npm-list-modules.bash
Created June 19, 2013 10:29
How to –correctly­– pass the result of 'npm list --global --parseable 2> /dev/null | grep generator' to the while loop, in order to extract unique module name
#!/usr/bin/env bash
dir=$1
if [[ ! -z $dir ]]; then
npm list --parseable 2> /dev/null | grep generator
else
# moduleList=$(<"")
while IFS= read -r module; do
echo "$(basename $module)"
@edouard-lopez
edouard-lopez / listing.bash
Created June 19, 2013 15:49
Is there a way to optimize my listing?
npm list --global --parseable 2> /dev/null \
| grep '/generator-' \
| while read line; do __yo_getSuggestion $line; done \
| sort -u \
| uniq
@edouard-lopez
edouard-lopez / install.sh
Created June 29, 2013 21:08
dpkg: dependency problems prevent configuration of lutris: python-yaml
sudo dpkg -i lutris_0.3.0_all.deb 2 ↵
[sudo] password for ed8:
Selecting previously unselected package lutris.
(Reading database ... 230497 files and directories currently installed.)
Unpacking lutris (from lutris_0.3.0_all.deb) ...
dpkg: dependency problems prevent configuration of lutris:
lutris depends on python-yaml; however:
Package python-yaml is not installed.
dpkg: error processing lutris (--install):
@edouard-lopez
edouard-lopez / post-update.sh
Created August 21, 2013 08:06
Fail: deployment post-update hook
#!/bin/bash
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".
#exec git update-server-info
function deploy() {