Skip to content

Instantly share code, notes, and snippets.

Bertrand Fan bertrandom

Block or report user

Report or block bertrandom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View simple.logo
View commands.c
typedef enum {
UP,
DOWN,
LEFT,
RIGHT,
X,
Y,
A,
B,
L,
View generate.sh
./gifenc.sh "babybump%02d.jpg" "babybump.gif"
View gist:57d10b8845b46cb313a242ca5bff44fc
convert babybump.gif \( +clone -set delay 300 \) +swap +delete -loop 0 babybump_with_pause.gif
View gifenc.sh
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=4,scale=320:-1:flags=lanczos"
ffmpeg -v warning -framerate 4 -f image2 -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -framerate 4 -f image2 -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
View crop.js
const async = require('async');
var gm = require('gm');
var sprintf = require("sprintf-js").sprintf;
var faces = require('./faces.json');
var bumps = [];
for (var i = 1; i <= 66; i++) {
bumps.push(i.toString());
}
View faces.json
{
"1": [
{
"faceId": "e2a4980d-6af1-4cad-b67d-9d72cb6b0c21",
"faceRectangle": {
"top": 563,
"left": 676,
"width": 113,
"height": 113
}
@bertrandom
bertrandom / private.xml
Created Aug 18, 2016
Karabiner config to set WASD keyboard F13 to display sleep
View private.xml
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>My_Keyboard_VendorID</vendorname>
<vendorid>0x04d9</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>My_Target_Keyboard_ProductID</productname>
View starwars.sh
#!/bin/bash
for i in `seq 1 7306`;
do
frame=$(printf '%06d' "$i")
echo $frame
curl "https://slack.com/api/chat.postMessage?token=SLACK_API_TOKEN&channel=CHANNEL_ID&username=Star%20Wars&text=http://starwars.toomanycooks.kitchen/out$frame.jpg&as_user=starwarsbot"
sleep 10
done
You can’t perform that action at this time.