Skip to content

Instantly share code, notes, and snippets.

Avatar

Frédéric Harper fharper

View GitHub Profile
@fharper
fharper / convert.sh
Last active Oct 2, 2020
Script to convert WAV file from my db9pro audio recorder & move them to Say&Go folder so IFTTT create a Todoist tasks with them
View convert.sh
# 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 Apr 21, 2019
code for an olb blog post
View 1.css
* {
margin: 5px;
}
#image {
visibility: hidden;
position: absolute;
left: 0px;
}
@fharper
fharper / cd-after-git-clone
Created Dec 17, 2018
CD into newly cloned folder automatically #lazyfred
View cd-after-git-clone
git()
{
if [ "$1" = clone ] ; then
/usr/bin/git "$@" && cd $(basename $_ .git)
echo 'Changing directory to repo folder...'
else
/usr/bin/git "$@"
fi
}
View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@fharper
fharper / audioplaylockscreen.html
Last active Dec 25, 2015
PlayingAudiLockScreen
View audioplaylockscreen.html
<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 Aug 26, 2013
Resize the canvas for different window size
View canvas.js
(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 Aug 3, 2013
How to listen to orientation change on Firefox OS
View orientation.js
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 Dec 20, 2015
How to play a mp4 in Firefox OS
View mp4.js
var activity = new MozActivity({
name: "view",
data: {
type: ["video/mp4"],
url: "http://techslides.com/demos/sample-videos/small.mp4"
}
});