Skip to content

Instantly share code, notes, and snippets.

Avatar

Gilles Doge gido

View GitHub Profile
@gido
gido / bookmark.js
Last active Mar 23, 2020
Bookmark to add time counter on Github Project
View bookmark.js
document.querySelectorAll('.js-column-time-count').forEach (el => el.remove());
columns = document.querySelectorAll('.project-column');
columns.forEach((column) => {
const nodeListLabels = column.querySelectorAll('.js-project-column-cards .project-card:not(.d-none) .issue-card-label > .css-truncate-target');
const detailContainer = column.querySelector('.details-container > .hide-sm');
const labels = [...nodeListLabels];
const totalTime = labels.reduce( (acc, el) => {
const match = el.innerText.match(/time: (½|[0-9]+)/);
if (null === match) {
return acc + 0;
@gido
gido / docker-compose.example1.yml
Last active Sep 13, 2021
Example to keep your bash history with docker compose
View docker-compose.example1.yml
version: '3.6'
services:
dev:
image: ubuntu
volumes:
# '~/.docker_bash_history' file should exist before mounting
- $HOME/.docker_bash_history:/root/.bash_history
# ...
View keybase.md

Keybase proof

I hereby claim:

  • I am gido on github.
  • I am gido (https://keybase.io/gido) on keybase.
  • I have a public key ASDxSGyFFy-_-NWltOX0CJvsLNWsAAV5f2UlSUqFD8LG1wo

To claim this, I am signing this object:

@gido
gido / stream-example.js
Created Jun 1, 2015
Playing with Stream and Nodejs
View stream-example.js
var request = require("request");
var zlib = require("zlib");
var csv = require("csv-streamify");
var Handlebars = require("handlebars");
var es = require("event-stream");
var tmpl = Handlebars.compile("<li><a href="{{URL}}">{{Name}}</a> ({{City}})</li>");
// HTTP GET Request
request("http://nodestreams.com/input/people.csv.gz")
@gido
gido / bookmarlet-harvest.js
Created May 13, 2015
Bookmarlet to display/preview the total hours in Harvest Estimate
View bookmarlet-harvest.js
var totalH = 0;
var hours = document.getElementsByClassName('item-qty desktop');
Array.prototype.forEach.call(hours, function(el) { totalH += parseFloat(el.innerHTML); });
var totalRow = document.querySelector('tr.total');
var totalLabelCol = document.querySelector('tr.total td.label');
var totalAmoundCol = document.querySelector('tr.total td.total');
var totalHoursCol = document.createElement('td');
totalHoursCol.innerHTML = totalH;
totalRow.insertBefore(totalHoursCol, totalAmoundCol);
@gido
gido / diskusage.js
Created Jan 15, 2015
Quick&Dirty script to get total disk usages of each account by crawling the Alwaysdata web administration
View diskusage.js
/**
* run:
* $ casperjs diskusage.js --user=myaccount --password=mypassword
*
* This script can lookup for env variables:
* ALWAYSDATA_USER
* ALWAYSDATA_PASSWORD
*/
var casper = require('casper').create({
//verbose: true,
@gido
gido / ad_newrelic_install.sh
Last active Dec 28, 2015
ad_newrelic_install.sh
View ad_newrelic_install.sh
#!/bin/bash
NRVERSION="4.1.5.24-linux"
NRBASEDIR="$HOME/newrelic"
MODULEDIR="$HOME/lib/php/extensions"
# get this value from 'uname -m'
ARCH=x64
# get this value from 'php -i|grep "PHP Extension"'
PHPAPI=20100525
PHPZTS=""
View drush-download.sh
# cd shared/
# download Drush
curl -C - -O -s http://ftp.drupal.org/files/projects/drush-7.x-5.8.tar.gz
# unarchive
tar -xf drush*.tar.gz
# set permissions
chmod u+x drush/drush
@gido
gido / gist:5318356
Created Apr 5, 2013
Install PEAR on Alwaysdata
View gist:5318356
# configure pear on your HOME
pear config-create ~ ~/.pearrc
# Install PEAR
pear install -o PEAR
# Add bin_dir to your path
echo "export PATH=$PATH:~/pear" >> .bash_profile
@gido
gido / macosx-install-php-oracle-oci8.md
Last active Jun 1, 2021
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.8 - homebrew environnement
View macosx-install-php-oracle-oci8.md

Installation

This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).

PHP 5.4 installed with Homebrew.

Update: I wrote a blog post about this.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):