Skip to content

Instantly share code, notes, and snippets.


Karim Ratib infojunkie

View GitHub Profile
infojunkie / serverless.yml
Last active Aug 16, 2021
Upload Zoom files to AWS S3
View serverless.yml
service: labyrinth-service
name: aws
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
- Effect: Allow
- lambda:InvokeFunction
infojunkie / package.json
Last active Dec 4, 2020
Running specific tests using mocha from a package.json script
View package.json
"scripts": {
"test": "mocha --grep /${TEST:-'.*'}/i",
infojunkie / .block
Last active Dec 18, 2016
VexFlow test #1
View .block
license: gpl-3.0
height: 300
infojunkie /
Last active Aug 24, 2021
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
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 Sep 15, 2021
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';