Skip to content

Instantly share code, notes, and snippets.

View fharper's full-sized avatar

Frédéric Harper fharper

View GitHub Profile
@fharper
fharper / convert.sh
Last active October 2, 2020 19:49
Script to convert WAV file from my db9pro audio recorder & move them to Say&Go folder so IFTTT create a Todoist tasks with them
# ensure the path is right
cd /Volumes/RECORD/RECORD
# delete bad files
find . -name "*.WAV" -type 'f' -size -1kb -delete
# batch process the recording
for f in *.WAV;
do
@fharper
fharper / 1.css
Last active April 21, 2019 17:59
code for an olb blog post
* {
margin: 5px;
}
#image {
visibility: hidden;
position: absolute;
left: 0px;
}
@fharper
fharper / cd-after-git-clone
Created December 17, 2018 20:29
CD into newly cloned folder automatically #lazyfred
git()
{
if [ "$1" = clone ] ; then
/usr/bin/git "$@" && cd $(basename $_ .git)
echo 'Changing directory to repo folder...'
else
/usr/bin/git "$@"
fi
}

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@fharper
fharper / audioplaylockscreen.html
Last active December 25, 2015 02:49
PlayingAudiLockScreen
<audio mozaudiochannel="content" preload="none" src="http://upload.wikimedia.org/wikipedia/en/4/45/ACDC_-_Back_In_Black-sample.ogg" autoplay></audio>
@fharper
fharper / canvas.js
Created August 26, 2013 14:24
Resize the canvas for different window size
(function() {
"use strict";
function resizeCanvas() {
var canvas = document.querySelector("#canvas");
var context = canvas.getContext("2d");
//Need to set the canvas size here, as it zoom with CSS
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
@fharper
fharper / orientation.js
Created August 3, 2013 17:11
How to listen to orientation change on Firefox OS
function functionToCallOnorientationChange() {
var orientation = screen.mozOrientation;
if (orientation === "portrait-primary" || orientation === "portrait-secondary" ) {
//do something
}
else if if (orientation === "landscape-primary" || orientation === "landscape-secondary" ) {
//do something else
}
}
@fharper
fharper / mp4.js
Last active December 20, 2015 07:09
How to play a mp4 in Firefox OS
var activity = new MozActivity({
name: "view",
data: {
type: ["video/mp4"],
url: "http://techslides.com/demos/sample-videos/small.mp4"
}
});