Skip to content

Instantly share code, notes, and snippets.

View vdebergue's full-sized avatar

Vincent Debergue vdebergue

View GitHub Profile
@vimcaw
vimcaw / craco.config.js
Created May 16, 2020 02:59
Using craco to override creat-react-app htmlWebpackPlugin options
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = () => {
return {
webpack: {
configure: (webpackConfig, { env }) => {
if (env !== 'development') {
const htmlWebpackPluginInstance = webpackConfig.plugins.find(
webpackPlugin => webpackPlugin instanceof HtmlWebpackPlugin
);
@vdebergue
vdebergue / transcode.sh
Last active December 4, 2019 13:07
Transcode h264 to h265
#! /bin/bash
set -x
set -e
FOLDER="$1"
MAX_BITRATE=3000000
if [ ! -d "$FOLDER" ]; then
echo "Please input a folder"
exit 1
@lbalmaceda
lbalmaceda / PemUtils.java
Created June 15, 2018 14:32
Pem Keys file reader for Java
//Copyright 2017 - https://github.com/lbalmaceda
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOF
@vdebergue
vdebergue / mixins.coffee
Created April 18, 2013 18:25
Example of how to do Mixins in Coffeescript similar to the Scala ones
class Mixable
@with: (classes...) ->
for clazz in classes
# add the class properties
for key, value of clazz
@[key] = value
# add the instance (prototype) properties
for key, value of clazz::
@::[key] = value