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 / 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 / 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 (Robin.Barker@npl.co.uk),
# 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 / 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 / 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 / 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 / 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 / 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
#!/bin/bash
echo '1 2 3' > sample.data
cut -d' ' -f1,3 sample.data | read X Z
echo $((X+Z))
@s-leroux
s-leroux / svglinkify.py
Last active January 26, 2017 15:02 — forked from oxplot/svglinkify.md
Add hyperlinks to PDFs created by Inkscape
#!/usr/bin/env python
# svglinkify.py - Add hyperlinks to PDFs generated by Inkscape
# Copyright (C) 2015 Mansour Behabadi <mansour@oxplot.com>
#
# This script comes with no warranty whatsoever. Use at your own risk.
# If you decide to distribute verbatim or modified versions of this
# code, you must retain this copyright notice.
#
# Usage: svglinkify.py <svg-file> <inkscape-gen-pdf> <linkified-pdf>
# Requires:
@s-leroux
s-leroux / build-from-scratch.sh
Last active May 10, 2017 11:50
Build from scratch script for RainyNite Studio (https://notabug.org/caryoscelus/rainynite-studio)
#!/bin/bash
set -e
shopt -s expand_aliases
alias make='make -j9'
sudo apt-get update
sudo apt-get install -y \
libblas-dev libgsl-dev python-cairo-dev \
libgtk2.0-dev libgtkmm-2.4-dev libcairomm-1.0-dev libcairo2-dev \