Skip to content

Instantly share code, notes, and snippets.

View EtienneDG's full-sized avatar
🐧

Etienne EtienneDG

🐧
  • Privateaser
  • France
View GitHub Profile
@EtienneDG
EtienneDG / githubBetterPr.js
Last active January 24, 2024 10:27
githubBetterPr.js
// ==UserScript==
// @name Better PR list
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Better PR listing to ease code reviews
// @author You
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant window.onurlchange
// @updateURL https://gist.githubusercontent.com/EtienneDG/61f2f27e156cd04d2d687d39655e57b9/raw
@EtienneDG
EtienneDG / trello.js
Last active January 6, 2024 14:29
Trello syntax highlighting
// ==UserScript==
// @name Trello syntax highlighting
// @namespace http://tampermonkey.net/
// @version 2024-01-05
// @description Add some code syntax highlighting for trello cards description
// @author EtienneDG
// @match https://trello.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=trello.com
// @grant GM_addStyle
// @grant GM_getResourceText
@EtienneDG
EtienneDG / git_subfolders.sh
Created September 3, 2021 17:32
Get first level subfolders with changes
git diff-tree $(git branch --show-current)..origin/master --name-only | grep -v '\.' | paste -sd, | sed 's/.*/(&)/'
@EtienneDG
EtienneDG / ffmpeg.sh
Last active March 5, 2020 14:36
ffmpeg snippets
# Concatenate videos without sound
ffmpeg -i fire.mp4 -i fire.mp4 -filter_complex "[0:v:0][1:v:0]concat=n=2:v=1[outv]" -map "[outv]" output.mp4
# Concatenate videos with sound
ffmpeg -i small.mp4 -i small.mp4 -filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" output.mp4
# Coloured and blured overlay
ffmpeg -y -i runner.mp4 \
-f lavfi -i "color=black:s=1280x720" \
-filter_complex "\
@EtienneDG
EtienneDG / run.py
Last active December 21, 2019 16:14
Vue1 to Vue2 auto migration tool
# Migrates files written in vue1 to vue2.
# Based on recommandation of vue-migration helper.
#
# Only applies the 'easy' recommandations:
# - suggested updates with the correct value
# - argument order
# - replace ready
# - some custom filters with arguments (moment, padLeft, ...)
#
# How to :
#!/bin/sh
# Darkify Slack on Mac OS:
SLACK_INTEROP_JS="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js"
# Thanks to: https://gist.github.com/DrewML/0acd2e389492e7d9d6be63386d75dd99#gistcomment-1856332
if ! [ -z "`grep tt__customCss ${SLACK_INTEROP_JS}`" ]; then
# Backup original CSS for reverts:
cp ${SLACK_INTEROP_JS} ${SLACK_INTEROP_JS}.bak
echo 'document.addEventListener("DOMContentLoaded",function(){let tt__customCss=`body { background: #222; color: #e6e6e6; } a { color: #949494; } a:link, a:visited { color: #6E9BF4; } a:hover, a:active, a:focus { color: #c7c7c7; } hr { border-bottom: 1px solid #424242; border-top: 1px solid #222; } h1, h2, h3, h4 { color: #e6e6e6; } h1 a { color: #e6e6e6; } h1 a:active, h1 a:hover, h1 a:link, h1 a:visited { color: #e6e6e6; } .bordered { border: 1px solid #363636; } .top_border { border-top: 1px solid #363636; } .bottom_border { border-bottom: 1px solid #363636; } .left_border { border-left: 1px solid #363636;
@EtienneDG
EtienneDG / test.js
Created September 15, 2016 12:31
Geocode an address
var csv = "",
addresses = ["1600 Amphitheatre Parkway,Mountain View,CA"];
for(let address of addresses)
{
$.get("https://maps.googleapis.com/maps/api/geocode/json?address=" + address,
function(res){
csv += res.results[0].geometry.location.lat + ",";
csv += res.results[0].geometry.location.lng ;
csv += "\n";
@EtienneDG
EtienneDG / OL.js
Last active August 29, 2015 14:01
Simple OpenLayers map
var map;
function init(){
//defining the projection and adding a map to an element
var sphericalMercatorProj = new OpenLayers.Projection('EPSG:900913');
var geographicProj = new OpenLayers.Projection('EPSG:4326');
map = new OpenLayers.Map('myMap');
//adding layers
@EtienneDG
EtienneDG / index.html
Last active August 29, 2015 13:59
[Geeksperiment][comix IO] : flashback queries post
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<!--First scene-->
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">In the morning...</tspan>
</label>
@EtienneDG
EtienneDG / gist:9250037
Created February 27, 2014 13:32
Geocode coordinates from file to file using google api
//Wait for document ready
document.addEventListener('DOMContentLoaded',function() {
var data;
var lat;
var lng;
var latlng;
/*
CSV file : first row is headers. Necessary heading id:
lat