Skip to content

Instantly share code, notes, and snippets.

import com.mysema.query.codegen.GenericExporter
import com.mysema.query.codegen.Keywords
import javax.persistence.Embeddable
import javax.persistence.Embedded
import javax.persistence.Entity
import javax.persistence.MappedSuperclass
import javax.persistence.Transient
group 'yma'
@ymauray
ymauray / demo.adoc
Last active April 11, 2016 12:45
Démo AsciiDoctor

PressCast: The ultimate book.

Ce bouquin est génialissime. Merci d’avoir lu PressCast: The ultimate book..

Core concepts

@ymauray
ymauray / show_constraints.sql
Last active July 13, 2016 08:29
Find all tables referencing a given table's primary key
SELECT S.TABLE_NAME SOURCE,
S.CONSTRAINT_NAME CONTRAINTE,
T.TABLE_NAME CIBLE,
T.CONSTRAINT_NAME PK
FROM USER_CONSTRAINTS S,
USER_CONSTRAINTS T
WHERE T.TABLE_NAME = '<target_table>'
AND T.CONSTRAINT_TYPE = 'P'
AND S.R_CONSTRAINT_NAME = T.CONSTRAINT_NAME;
---
#! /bin/bash
a=/tmp/xx/file.tar.gz
# /tmp/xx
xpath=${a%/*}
# file.tar.gz
xbase=${a##*/}
@ymauray
ymauray / extract_video.sh
Created July 15, 2016 19:34
How to cut a video file on black keyframes
# Re-encode source video with one keyframe every 5 frames
ffmpeg -i source.mkv -g 5 tmp.mkv
# Search black frames
ffmpeg -i tmp.mkv -vf blackframe -f null -
# Use output to locate black frames right on keyframes
# Then cut video at those keyframes
ffmpeg -i tmp.mkv -ss 6.089 -to 180.263 -c copy tmp2.mkv
<?php
$api_request = 'http://.......';
$api_response = wp_remote_get( $api_request );
$api_data = json_decode( wp_remote_retrieve_body( $api_response ), true );

Keybase proof

I hereby claim:

  • I am ymauray on github.
  • I am ymauray (https://keybase.io/ymauray) on keybase.
  • I have a public key whose fingerprint is 2CDF 2AB0 3B53 F39A 9039 BE87 4A11 A1BE 3115 C919

To claim this, I am signing this object:

#! /bin/bash
sudo apt-get install build-essential libc6-dev libglib2.0-dev libjack-dev jackd libvorbis-dev libsamplerate0-dev libsndfile1-dev python-gtk2-dev libmpg123-dev libavcodec-dev libavformat-dev libtwolame-dev libmp3lame-dev libflac-dev python-mutagen libspeex-dev git-core autoconf libtool autopoint imagemagick libtool-bin
mkdir ~/dev
cd ~/dev
mkdir ffmpeg
cd ffmpeg/
mkdir archive
cd archive
wget http://ffmpeg.org/releases/ffmpeg-3.2.4.tar.bz2
@ymauray
ymauray / monitor.py
Created February 20, 2017 16:56
Monitor for iDJC patched with the "on-air" signal
#! /usr/bin/python2.7
"""monitor.py
Monitors events from iDJC.
Requires IDJC 0.8.11 or higher.
Takes the profile you wish to monitor as the command line parameter.
"""
#!/bin/sh
### BEGIN INIT INFO
# Provides: firewall
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Sets/unsets iptables rules
# Description: Sets/unsets iptables rules.
# This script will set/unset iptables rules.