Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

Jean-Michaël Celerier jcelerier

🌴
On vacation
View GitHub Profile
@sjgriffiths
sjgriffiths / SparseSet.h
Last active Mar 13, 2020
Sparse set (C++)
View SparseSet.h
/**
SparseSet.h
Implements a class template of a sparse
set of unsigned integers.
@author Sam Griffiths
www.computist.xyz
*/
#pragma once
@jeffpamer
jeffpamer / encode.sh
Created Mar 16, 2018
Smooth Scrubbing Web Video FFMPEG Mega Command
View encode.sh
ffmpeg -i input.mp4 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 -an -vf "scale=-1:1440, reverse" -preset veryslow -g 2 output.mp4
// -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3
// Encode for web with a good balance of browser compatibility and compression ratio
// -an
// Strip audio tracks
// -vf "scale=-1:1440, reverse"
// Scale video to 1440px wide, maintaining aspect ratio
View LICENSE
This work, excluding the Arch Linux logo, is made available under CC0: https://creativecommons.org/publicdomain/zero/1.0/
@cryzed
cryzed / fix-infinality.md
Last active Sep 16, 2021
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.
View fix-infinality.md

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@targodan
targodan / LICENSE
Last active Jul 19, 2021
Complementing code for my blog post "Decoding audio files with ffmpeg": https://www.targodan.de/post/decoding-audio-files-with-ffmpeg
View LICENSE
The MIT License (MIT)
Copyright (c) 2016 Luca Corbatto
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
@probonopd
probonopd / melvanimate.md
Last active Dec 11, 2017
Getting Melvanimate to fly :-)
View melvanimate.md

Getting Melvanimate to fly :-)

What is Melvanimate?

Melvanimate is a library for ESP8266 that lets you control your Neopixels over WLAN easily. It supports everything imaginable besides toasting your toast, e.g.,:

  • Animate Neopixels (hence the name!) or set them to solid colors
  • Control LEDs via a web interface (for casually setting a certain color of effect)
  • Control LEDs via MQTT or DMX/E131 (for automation)
  • Adalight DIY ambient monitor lighting similar to Ambilight
@vidavidorra
vidavidorra / auto-deploy_documentation.md
Last active Sep 23, 2021
Auto-deploying Doxygen documentation to gh-pages with Travis CI
View auto-deploy_documentation.md

Auto-deploying Doxygen documentation to gh-pages with Travis CI

This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages branch using Travis CI. This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.

Sign up for Travis CI and add your project

Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.

Create a clean gh-pages branch

To create a clean gh-pages branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th

View memcount_sse2.c
size_t memcount_sse2(const void *s, int c, size_t n) {
__m128i cv = _mm_set1_epi8(c), sum = _mm_setzero_si128(), acr0,acr1,acr2,acr3;
const char *p,*pe;
for(p = s; p != (char *)s+(n- (n % (252*16)));) {
for(acr0 = acr1 = acr2 = acr3 = _mm_setzero_si128(),pe = p+252*16; p != pe; p += 64) {
acr0 = _mm_add_epi8(acr0, _mm_cmpeq_epi8(cv, _mm_loadu_si128((const __m128i *)p)));
acr1 = _mm_add_epi8(acr1, _mm_cmpeq_epi8(cv, _mm_loadu_si128((const __m128i *)(p+16))));
acr2 = _mm_add_epi8(acr2, _mm_cmpeq_epi8(cv, _mm_loadu_si128((const __m128i *)(p+32))));
acr3 = _mm_add_epi8(acr3, _mm_cmpeq_epi8(cv, _mm_loadu_si128((const __m128i *)(p+48)))); __builtin_prefetch(p+1024);
}
View gist:516dba19737a498ce72d
#include <tuple>
#include <initializer_list>
#include <math.h>
#include <utility>
using namespace std;
template <typename Tup1, typename Tup2, size_t...s>
double euclidean_distance_impl (Tup1 const &tup1, Tup2 const &tup2, index_sequence<s...>)
@daniel-j-h
daniel-j-h / really_strong_typedef.cc
Last active Dec 21, 2015
REALLY_STRONG_TYPEDEF
View really_strong_typedef.cc
#include <type_traits>
#include <iostream>
#define REALLY_STRONG_TYPEDEF(From, To) \
class To final { \
static_assert(std::is_scalar<From>(), ""); \
From x; \
\
public: \
To() = default; \