Skip to content

Instantly share code, notes, and snippets.

View mathieu-aubin's full-sized avatar
💭
blop!

Mathieu Aubin mathieu-aubin

💭
blop!
  • Montreal, Quebec, Canada
View GitHub Profile
@digitalresistor
digitalresistor / redir.sh
Last active November 13, 2016 18:43
Simple script that prints a list of redirects, and what the final HTTP result was...
function count_redir {
curl -L -I -D - -o /dev/null $1 | awk 'BEGIN { redir = 0; status = 200; } tolower($1) ~ /http/ { redir=redir+1; status=$2 } tolower($1) ~ /location:/ { print redir, status, $2 } END { print "Completed, with ", redir-1, "redirects. Final result: ", status }'
}
@takien
takien / lowsrc.js
Created December 24, 2012 17:07
Alternate to lowsrc. usage: <img src="lowres.jpg" data-src="highres.jpg" />
/**
* Laod large image at last.
* requires jQuery
* @author: takien
*/
jQuery(document).ready(function($){
$('img').each(function(){
var hires = $(this).data().src;
if((hires != undefined) && (hires != '')){
$(this).attr('src',hires);
@mathieu-aubin
mathieu-aubin / c7repos.sh
Last active June 28, 2018 03:27
Centos 7 basic repository installation (C7Repos)
#!/bin/bash
bash <(curl -4sLk https://bit.ly/c7repos)
# Deprecated -- use the gitHUB repository instead
@hzlzh
hzlzh / gist:1441823
Created December 7, 2011 07:12
Generate ip-to-country.bin file from ip-to-country.cvs
# use for WordPress Plugin: Show Useragent
# https://github.com/hzlzh/Show-Useragent
wget http://files.firestats.cc/ip2c/ip2c-2.0.0.zip
unzip ip2c-2.0.0.zip
cd ip2c
wget http://software77.net/geo-ip/?DL=1 -O IpToCountry.csv.gz
gunzip IpToCountry.csv.gz
java -jar ip2c.jar -c IpToCountry.csv IpToCountry.bin
ls -sSh

An engineering manager that I have the privilege of working with just asked me for three expectations of a principal engineer for a project that he is working on to mentor senior engineers at Twilio. Here is the list that I came up with.

  • Skate to where the puck is going: Are you waiting to be told what to do or are you getting a sense for our product vision and making concrete suggestions for what technical work needs to be done to get us in a good place when it becomes time to execute?
  • Act like an owner: Are you complaining about what's broken or offering solutions and/or alternative ways of thinking that makes it clear to engineers close to the problem that they can play an important role in solving those problems? Do you accept the world as it is or are you willing to provide a compelling vision for how it could be?
  • Teach and lead: You're not getting more hours in the day. Taking on all of the hard work not only makes you a single point of failure, it robs your colleagues of the ability
@silverkorn
silverkorn / ffmpeg-nonfree-build-centos-7.sh
Last active February 24, 2022 21:31
An automated script to build FFmpeg non-free on RHEL/CentOS with as much features as possible. (Including mediainfo for debugging)
# TODO: Verify to link statically some dependencies usually not available in a default instllation of RHEL/CentOS (ex.: libxcb)
###################
## Configuration ##
###################
FFMPEG_CPU_COUNT=$(nproc)
FFMPEG_ENABLE="--enable-gpl --enable-version3 --enable-nonfree --enable-runtime-cpudetect --enable-gray --enable-openssl --enable-libfreetype"
FFMPEG_HOME=/usr/local/src/ffmpeg
@mathieu-aubin
mathieu-aubin / dlpatent
Last active June 22, 2022 10:02
Download PDF patent files from https://patents.google.com using download url and description
#!/bin/bash
#
# Downloads patent files from patents.google.com as pdf
# Must provide 2 arguments which are.. (quotes encapsulated)
#
# File URL (pdf download link)
# Description or name of patent
#
# File will be saved as PATENT#_DESCRIPTION.pdf
#
@alexeyten
alexeyten / dabblet.css
Created July 1, 2013 06:23
SVG compare
/**
* SVG compare
*/
svg {
width: 16px;
height: 16px;
}
@adrianocalvitto
adrianocalvitto / wp-cli-export-woo-orders.txt
Last active December 7, 2022 03:33
Export All WooCommerce Orders via WP-CLI in a single .xml file
wp export --post__in=$(wp eval 'foreach( get_posts(array("post_type" => "shop_order", "posts_per_page" => -1, "fields" => "ids")) as $id ) { echo $id. ","; }') --max_file_size=200