Skip to content

Instantly share code, notes, and snippets.

View s-leroux's full-sized avatar

Sylvain Leroux s-leroux

View GitHub Profile
@s-leroux
s-leroux / im.sh
Last active October 30, 2016 09:47
Blueish frame
#!/bin/bash
COLOR="#59838c"
for f in FRAME-*.png; do convert \( -size 1920x1080 xc:black \) \( $f -alpha Off -level 10%,100% -negate \) -compose CopyOpacity -composite ${f/FRAME/ALPHA}; done
for f in ALPHA-*.png; do convert \( -size 1920x1080 xc:"$COLOR" \) \( $f \) -compose Over -composite ${f/ALPHA/OVER}; done
@s-leroux
s-leroux / compare.sh
Last active October 9, 2017 13:20
LightWorks on Linux/MacOSX does produce random audio artifacts when rendering a project. This script is a workaround comparing three independent renderings to guess those that do not contain those artifacts.
#!/bin/bash
function usage() {
echo Usage: $0 dir1 ...dirN [+GLOB] >&2
}
function fail() {
echo $1 >&2
usage
@s-leroux
s-leroux / FixedBlend.fx
Last active November 5, 2018 14:17
Extra Blend modes / Lightworks effects
//--------------------------------------------------------------//
// MoreBlend.fx
//
// Copyright (c) Sylvain Leroux. All Rights Reserved
//--------------------------------------------------------------//
int _LwksEffectInfo
<
string EffectGroup = "GenericPixelShader";
string Description = "Fixed Blend";
@s-leroux
s-leroux / Polymask.fx
Last active July 12, 2016 00:09
Pologon mask effect for LightWorks
//--------------------------------------------------------------//
// Header
//
// Lightworks effects have to have a _LwksEffectInfo block
// which defines basic information about the effect (ie. name
// and category). EffectGroup must be "GenericPixelShader".
//--------------------------------------------------------------//
int _LwksEffectInfo
<
string EffectGroup = "GenericPixelShader";
@s-leroux
s-leroux / pgist.sh
Created June 24, 2016 09:46
Post GIST
# 0. Your file name
FNAME=some.file
# 1. Somehow sanitize the file content
# Remove \r (from Windows end-of-lines),
# Replace tabs by \t
# Replace " by \"
# Replace EOL by \n
CONTENT=$(sed -e 's/\r//' -e's/\t/\\t/g' -e 's/"/\\"/g' "${FNAME}" | awk '{ printf($0 "\\n") }')
@s-leroux
s-leroux / prename
Last active October 10, 2020 10:30
`prename` script from the Debian Perl Package by Robin Barker. Distributed under the terms of the Perl license (http://dev.perl.org/licenses/)
#!/usr/bin/perl -w
#
# This script was developed by Robin Barker ([email protected]),
# from Larry Wall's original script eg/rename from the perl source.
#
# This script is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
# Larry(?)'s RCS header:
# RCSfile: rename,v Revision: 4.1 Date: 92/08/07 17:20:30
@s-leroux
s-leroux / fixtures_dishes.js
Last active May 8, 2016 12:07
"Introduction to Server-side Development" course by Jogesh Muppala on Coursera -- test files for week 4
/* test/fixtures/fixtures_dishes.js */
module.exports = [
{
"_id" : "000000000000000000001100",
"updatedAt" : "2016-03-21T23:14:53.548Z",
"createdAt" : "2016-03-21T23:14:53.548Z",
"name" : "Uthapizza",
"image" : "images/pizza.png",
@s-leroux
s-leroux / fixtures_promotions.js
Created March 28, 2016 00:04
"Introduction to Server-side Development" course by Jogesh Muppala on Coursera -- test file for assignment 3
/* test/fixtures/fixtures_promotions.js */
module.exports = [
{
"_id" : "000000000000000000001100",
"updatedAt" : "2016-03-21T23:18:37.283Z",
"createdAt" : "2016-03-21T23:14:53.548Z",
"name" : "Grand buffet",
"image" : "images/buffet.png",
@s-leroux
s-leroux / fixtures_dishes.js
Last active April 2, 2016 21:25
"Introduction to Server-side Development" course by Jogesh Muppala on Coursera -- test files for week 3
/* test/fixtures/fixtures_dishes.js */
module.exports = [
{
"_id" : "000000000000000000001100",
"updatedAt" : "2016-03-21T23:14:53.548Z",
"createdAt" : "2016-03-21T23:14:53.548Z",
"name" : "Uthapizza",
"image" : "images/pizza.png",
@s-leroux
s-leroux / test_models.js
Created March 21, 2016 00:18
"Introduction to Server-side Development" course by Jogesh Muppala on Coursera -- test file for assignment 2
var mongoose = require('mongoose');
var url = 'mongodb://localhost:27017/conFusion';
mongoose.connect(url);
var db = mongoose.connection;
var assert = require('assert');
var Dishes = require('../models/dishes');
var Promotions = require('../models/promotions');
var Leaders = require('../models/leadership');