Skip to content

Instantly share code, notes, and snippets.

View borisschapira's full-sized avatar

Boris Schapira borisschapira

View GitHub Profile
@borisschapira
borisschapira / filter.svg
Created February 11, 2022 09:56
SVG filter for white drop shadow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@borisschapira
borisschapira / .profile
Last active February 22, 2019 15:56
Open code for workspace if available, file if configured, new workspace if nothing else
# A function to replace the `code` command
#
# With args: does what's intended.
# ```
# > code ~/.bash_history
# ```
#
# With no args, opens the first workspace it founds
# in the current folder, or a new workspace based
# on the current folder if none exists.
@borisschapira
borisschapira / encoding-video.md
Created November 30, 2017 20:53 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@borisschapira
borisschapira / ffmpegboris
Last active February 9, 2018 18:37
Config ffmpeg pour réencoder mes vidéos (gain de ~10x par rapport à la sortie de mon tél, ~5x par rapport à au Sony N5)
ffmpegboris() {
ffmpeg -i $1 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -movflags +faststart -vf scale=-2:720,format=yuv420p $1.optimized.mp4
}
ffmpegborisall () {
for i in *.(AVI|MP4|MOV|mov|mp4); do
if [[ ${i} != *"optimized"* ]];then
ffmpegboris $i;
fi
done
@borisschapira
borisschapira / functions.php
Created March 15, 2017 16:47
Displaying current branch in Wordpress Admin Area
/**
* Get the git branch
* @return mixed Either the branch name or the HEAD content or a boolean false
*/
function get_current_git_commit() {
if ( $hash = file_get_contents( get_home_path().'.git/HEAD' ) ) {
preg_match('/ref: refs\/heads\/(.*)/', $hash, $matches, PREG_OFFSET_CAPTURE);
if(count($matches)>=2) {
return $matches[1][0];
} else {
{
// Police à ligature
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
// Taille maximum des lignes et
// affichage des espaces
"editor.wrappingColumn": 80,
"editor.wordWrap": true,
"editor.renderWhitespace": "boundary",
@borisschapira
borisschapira / style.sass
Last active April 11, 2018 09:38
Professional CSS for Markdown Here
$main:#066a81;
$grey:rgb(245, 245, 245);
$text-color: #000;
$background: rgb(245,245,245);
$fontStack: arial, helvetica, sans-serif;
$codeFontStack: Consolas, Inconsolata, Courier, monospace;
/*
* NOTE:
@borisschapira
borisschapira / amp.bookmark.min.js
Last active June 22, 2018 08:48
AMP Bookmarket : go to the AMP version of the current page.
javascript:(function(){var ampCol = document.querySelectorAll('link[rel="amphtml"');if(ampCol){location.href=ampCol[0].href;}})();
@borisschapira
borisschapira / multitail.conf
Created February 12, 2016 08:50 — forked from Stubbs/multitail.conf
Basic Multitail config for colourising Symfony2 log files.
colorscheme:symfony
cs_re:cyan:^\[....-..-.. ..:..:..\]
cs_re:blue: .*\.(INFO|NOTICE).*
cs_re:red: .*\.(ERROR|CRITICAL).*
cs_re:blue: \{[^}]+\}
Verifying that +borisschapira is my blockchain ID. https://onename.com/borisschapira