Skip to content

Instantly share code, notes, and snippets.

View gambitier's full-sized avatar
🏆
Open for collaboration

Akash Jadhav gambitier

🏆
Open for collaboration
View GitHub Profile

Convert GIF files to WebP and WebM format to save space when archiving

In the following post I want to share something for users who have tons of GIFs and want to store or archive the information in a more space-saving way.

Disclaimer: I do not take responsibility for any damages to or losses of your files.

Do you also have dozens of GIF files and ever wondered why a little bit blinking or a movement of few seconds needs several MB storage? If it is your own content, you need them in original state or anything similar, you can stop reading any further.

GIF files have been invented a very long time ago (you remember 1987?) and weren't meant to be used for displaying an anime or short movie clip and the like. Therefore the format and compression (is no longer) isn't efficient enough.

@gambitier
gambitier / .golangci.yml
Created August 5, 2024 14:28 — forked from maratori/.golangci.yml
Golden config for golangci-lint
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers
## Golden config for golangci-lint v1.59.1
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt and change it for your needs.
run:
@gambitier
gambitier / deepGroupBy.js
Created January 6, 2023 06:11 — forked from leofavre/deepGroupBy.js
Similar to LoDash groupBy(), but with nested groups.
/**
* Part of [Canivete](http://canivete.leofavre.com/#deepgroupby)
*
* Groups the contents of an array by one or more iteratees.
* Unlike Lodash [`groupBy()`](https://lodash.com/docs/4.17.4#groupBy),
* this function can create nested groups, but cannot receive
* strings for iteratees.
*/
const deepGroupBy = (collection, ...iteratees) => {
let paths = collection.map(value => iteratees.map(iteratee => iteratee(value))),
@gambitier
gambitier / github_clone_using_token.sh
Created December 1, 2022 13:39 — forked from magickatt/github_clone_using_token.sh
Clone a GitHub repository using a Personal Access Token
export GITHUB_USER=magickatt
export GITHUB_TOKEN=secret
export GITHUB_REPOSITORY=magickatt/ContainerisingLegacyApplicationsTalk
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
@gambitier
gambitier / regex.md
Created September 3, 2022 10:56 — forked from etiennemarais/regex.md
Regular expression for handlebars variables, includes, if/else blocks and unescaped variables

Regex

{{[{]?(.*?)[}]?}}

Captures the value of the variable name in a handlebars template

{{> components/templates/email/includes/email-tr-spacer }}
{{# deliveryAddress }}
@gambitier
gambitier / s3download_promise.js
Created February 1, 2022 09:06 — forked from milesrichardson/s3download_promise.js
S3 download promise: nodeJS promise to download file from amazon S3 to local destination
const AWS = require('aws-sdk');
const fs = require('fs')
const s3download = (bucketName, keyName, localDest) => {
if (typeof localDest == 'undefined') {
localDest = keyName;
}
let params = {
@gambitier
gambitier / augumented_hdf5_matrix.py
Created April 14, 2019 09:18 — forked from wassname/augumented_hdf5_matrix.py
How to do data augmentation on a keras HDF5Matrix
"""Another way, note this one will load the whole array into memory ."""
from keras.preprocessing.image import ImageDataGenerator
import h5py
from keras.utils.io_utils import HDF5Matrix
seed=0
batch_size=32
# we create two instances with the same arguments
data_gen_args = dict(
rotation_range=90.,
@gambitier
gambitier / cuda_installation_on_ubuntu_18.04
Created January 11, 2019 11:19 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
cuda 9.0 complete installation procedure for ubuntu 18.04 LTS
#!/bin/bash
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
@gambitier
gambitier / ruby_tests.rb
Last active December 27, 2019 13:15 — forked from hpjaj/gist:ef5ba70a938a963332d0
RSpec - List of available Expectation Matchers - from Lynda.com course 'RSpec Testing Framework with Ruby'
## From Lynda.com course 'RSpec Testing Framework with Ruby'
describe 'Expectation Matchers' do
describe 'equivalence matchers' do
it 'will match loose equality with #eq' do
a = "2 cats"
b = "2 cats"
expect(a).to eq(b)
@gambitier
gambitier / cuda_9.0_cudnn_7.0.sh
Created August 13, 2018 18:27 — forked from ashokpant/cuda_9.0_cudnn_7.0.sh
Install CUDA Toolkit v9.0 and cuDNN v7.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v9.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb)
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda-9-0