Skip to content

Instantly share code, notes, and snippets.

View gido's full-sized avatar

Gilles Doge gido

View GitHub Profile
@gido
gido / docker-compose.example1.yml
Last active September 28, 2022 13:01
Example to keep your bash history with docker compose
version: '3.6'
services:
dev:
image: ubuntu
volumes:
# '~/.docker_bash_history' file should exist before mounting
- $HOME/.docker_bash_history:/root/.bash_history
# ...
@gido
gido / macosx-install-php-oracle-oci8.md
Last active June 1, 2021 08:49
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.8 - homebrew environnement

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):

@gido
gido / bookmark.js
Last active March 23, 2020 12:12
Bookmark to add time counter on Github Project
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 / keybase.md
Created January 23, 2019 19:30
Keybase

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 / ad_newrelic_install.sh
Last active December 28, 2015 03:39
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=""
# 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 April 5, 2013 10:44
Install PEAR on Alwaysdata
# 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 / deploy.rb
Created December 11, 2012 22:08
Our capifony/capistrano config
# app/config/deploy.rb
#
# Multistage deploy config.
# require capistrano-ext
# see: http://www.zalas.eu/multistage-deployment-of-symfony-applications-with-capifony
#
set :stage_dir, 'app/config/deploy'
require 'capistrano/ext/multistage'
@gido
gido / simple_accordion.html
Created February 9, 2011 18:15
not tested
HTML:
<div class="header with-cool-bottom-background-image"></div>
<div class="container">
<div class="panels">
<div class="panel1" style="display: none">
<h1>Cool Default Content (homepage)</h1>
</div>
<div class="panel2" style="display: none">
<h1>This nice content is hidden by default and will be displayed only on link click below.</h1>
</div>
@gido
gido / blackify hex color
Created December 13, 2010 13:14
Example of a simple script to manipulate hexadecimal color
<?php
$input = "#A2D73A";
if(!preg_match('/#([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})/', $input, $matches)){
die(sprintf("Error: '%s' is not a valid hexadecimal color!", $input));
}
$bgColor1 = $input;
$bgColor2 = blackify($input, 60);