Skip to content

Instantly share code, notes, and snippets.


Karim Ratib infojunkie

View GitHub Profile
infojunkie / .block
Last active Dec 18, 2016
VexFlow test #1
View .block
license: gpl-3.0
height: 300
infojunkie /
Last active Dec 20, 2019
Convert audio track/album to YouTube video


A recipe to prepare audio file(s) for YouTube upload. Video will be a slideshow of images on repeat.

Requires: imagemagick ffmpeg

  1. Convert images to required size. Here I assume .png files and output to png/ folder. See

for f in *.png; do convert "$f" -resize 800x600 -gravity center -background black -extent 800x600 png/"$f".png; done

infojunkie /
Created Aug 18, 2016
MIDI keyboard inversion using music21
import sys
from music21 import *
mf = midi.MidiFile()[1])
s = midi.translate.midiFileToStream(mf)
for n in s.flat.notes:
for p in n.pitches:
infojunkie /
Last active Aug 29, 2015
Drupal theme tokens
name = Token Theme
description = Create tokens for theme settings.
core = 7.x
infojunkie /
Last active Aug 29, 2015
Debug info for Drupal forms
name = Devel forms
description = Tools for developing and debugging Form API.
package = Development
core = 7.x
dependencies[] = devel
View gist:11232218
### Keybase proof
I hereby claim:
* I am infojunkie on github.
* I am kratib ( on keybase.
* I have a public key whose fingerprint is 242A D815 51B9 39D4 7013 0F1F E814 5192 B6EA 54BC
To claim this, I am signing this object:
View demo_i18n.module
* Implements hook_views_query_alter().
function demo_i18n_views_query_alter(&$view, &$query) {
infojunkie / views_join_translation.module
Last active Dec 17, 2015
A Drupal Views join handler to be used with node translation relationships. This join returns translated nodes *or* the node itself if it is not translated. This is useful to guarantee that some node is returned. To understand the context:
View views_join_translation.module
* Implements hook_views_data_alter().
function views_join_translation_views_data_alter(&$data) {
$data['node']['translation']['relationship']['join_handler'] = 'views_join_translation';
infojunkie / HelloPHPExcel.php
Last active Mar 23, 2018
HelloPOI - first experiment with Apache POI vs. PHPExcel
View HelloPHPExcel.php
$workbook = PHPExcel_IOFactory::load($argv[1]);
$sheet = $workbook->getSheet(0);
foreach ($rit = $sheet->getRowIterator() as $row) {
foreach ($cit = $row->getCellIterator() as $cell) {
echo $cell->getCoordinate() . " - ";
infojunkie / tree.groovy
Created Sep 6, 2011
Gremlin steps for tree traversal.
View tree.groovy
// Taken from:
// Gremlin user-defined defined tree() steps
// inTree() and outTree()
// closure can't have the same name as the defined step
_tree = { vertices ->
def results = []
vertices.each() {
results << it
You can’t perform that action at this time.