Skip to content

Instantly share code, notes, and snippets.

View romain-h's full-sized avatar

Romain Hardy romain-h

View GitHub Profile
@romain-h
romain-h / ffmpeg.md
Created November 11, 2019 19:56 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@romain-h
romain-h / wrap-amd-definition.js
Last active June 15, 2017 08:49
[Codemods - Medium post]
root.find(j.ExpressionStatement, {
expression: {
type: 'AssignmentExpression',
operator: '=',
},
})
.filter(path =>
path.value.expression.left &&
isGBNamespaced(path.value.expression.left)
)
// Create imports and definitions
const files = [];
const names = [];
store.forEach((imports, type) => {
imports.forEach(imp => {
files.push(j.literal(`src/base/${type}/${kebabCase(imp)}`));
names.push(j.identifier(imp));
});
});
@romain-h
romain-h / collect-gb-usages.js
Created June 15, 2017 08:37
[codemods - Medium post]
const collectGBUsages = (refStore, store) => node =>
node.find(j.MemberExpression, { // XX.XXXX
object: { type: 'MemberExpression' },
})
.filter(path => (
path.parentPath.value.type !== 'AssignmentExpression' &&
isGBNamespaced(path.value) // Check GB.xxx
))
.forEach(path => {
refStore.add(path);
@romain-h
romain-h / collect-usage.js
Last active June 15, 2017 08:26
Codemods medium post
const collectGBUsages = (refStore, store) => node =>
node.find(j.MemberExpression, { // XX.XXXX
object: { type: 'MemberExpression' },
})
.filter(path => (
path.parentPath.value.type !== 'AssignmentExpression' &&
isGBNamespaced(path.value) // Check GB.xxx
))
.forEach(path => {
refStore.add(path);
@romain-h
romain-h / my.cnf
Created June 5, 2017 08:10 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
[mysqld]
max_allowed_packet=64M
@romain-h
romain-h / main.js
Created August 31, 2015 15:11
Simple ES6 node endpoint
import express from 'express';
import logger from 'morgan';
import bodyParser from 'body-parser';
let app = express();
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
@romain-h
romain-h / osx-settings.sh
Last active August 29, 2015 14:26 — forked from wtw/osx-settings.sh
OSX Settings
#!/usr/bin/env sh
## Set some nice Mac OS system defaults
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@romain-h
romain-h / test.py
Last active August 29, 2015 14:02
Class Variable Python vs. Ruby.
class Foo():
bar = 1 # class variable (acting like static variable)
print 'Initial value: %s <address: %s>' % (Foo.bar, hex(id(Foo.bar))) # Initial address
### Initial value: 1 <address: 0x7fac604109f8>
instance1 = Foo()
print 'value: %s <address: %s>' % (instance1.bar, hex(id(instance1.bar))) # print static var
### value: 1 <address: 0x7fac604109f8>
@romain-h
romain-h / package.json
Last active August 29, 2015 14:01
Simple Rest server template based on Express.js
{
"name": "Rest_Server_Sandbox",
"description": "Sandbox server express",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "4.x",
"morgan": "~1.1.1",
"body-parser": "~1.2.2"
}