Skip to content

Instantly share code, notes, and snippets.

View xseignard's full-sized avatar
🦄
Internet thuggin'

Xavier Seignard xseignard

🦄
Internet thuggin'
View GitHub Profile
@mrousavy
mrousavy / MEMOIZE.md
Last active May 12, 2024 11:17
Memoize!!! 💾 - a react (native) performance guide
In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and  
returning the cached result when the same
inputs occur again.                                         
                                                     — wikipedia
@derekstavis
derekstavis / FastList.tsx
Last active April 30, 2024 14:50 — forked from vishnevskiy/FastList.js
Discord's FastList, but in TypeScript
import { forEachObjIndexed } from "ramda";
import * as React from "react";
import {
Animated,
ScrollView,
View,
ViewStyle,
LayoutChangeEvent,
NativeScrollEvent,
} from "react-native";
@408881465
408881465 / xbee.ino
Created April 2, 2019 23:27 — forked from bgentry/xbee.ino
XBee ZigBee HA interaction, Arduino example
/**
This is an implementation of Zigbee device communication using an XBee
and a Centralite Smart Switch 4256050-ZHAC
dave (www.desert-home.com)
source: http://www.desert-home.com/2014/10/zigbee-protocol-xbee-but-this-time.html
*/
// This code will handle both a Uno and a Mega2560 by careful use of
// the defines. I tried it on both of them, and the only problem is that
@sibelius
sibelius / metro.config.js
Created December 30, 2018 11:28
Metro config to make react native play nice with monorepos
const path = require('path');
const getWorkspaces = require('get-yarn-workspaces');
const blacklist = require('metro-config/src/defaults/blacklist');
const workspaces = getWorkspaces(__dirname);
module.exports = {
projectRoot: path.resolve(__dirname, 'packages/app'),
@courtarro
courtarro / xbee_zha_settings.md
Created February 19, 2018 20:01
XBee settings for Zigbee Home Automation (ZHA)

According to https://forms.na1.netsuite.com/app/site/hosting/scriptlet.nl?script=457&deploy=2&compid=818164&h=5928a16f2b6f9582b799&article=zigbee-home-automation

When developing a Zigbee Home Automation application or Wanting to talk with a Zigbee Home Automation Device, the XBee module you should select is the XBee ZB SMT module or XBee ZB (Zigbee) Surface Mount module.

Using our XCTU software or some other Terminal Emulator or processor, the following settings within the XBee ZB SMT module would need to be set:

  • ZS 2
  • AP 1
  • AO 3
  • EE 1
@beesandbombs
beesandbombs / wavingCubes.pde
Created September 11, 2017 22:23
waving cubes
// gif by dave @beesandbombs :)
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@Brainiarc7
Brainiarc7 / nvenc-capabilities-ffmpeg.md
Last active October 10, 2023 23:26
See the supported NVENC and NPP capabilities in your FFmpeg build

Quickly check for supported NVENC and NPP hardware acceleration capabilities in FFmpeg on your platform:

Depending on how you built ffmpeg, you may want to check the supported NVENC-based hardware acceleration capabilities in ffmpeg by running:

$ for i in encoders decoders filters; do
    echo $i:; ffmpeg -hide_banner -${i} | egrep -i "npp|cuvid|nvenc|cuda|nvdec"
done

Sample output (as on my testbed):

@Brainiarc7
Brainiarc7 / ffmpeg-multi-instances-xargs.md
Last active July 7, 2023 08:32
This gist will show you how to launch multiple ffmpeg instances with xargs, very useful for NVIDIA NVENC based encoding where standard GPUs limit the maximum simultaneous encode sessions to two.

Spawning multiple ffmpeg processes with xargs:

On standard NVIDIA GPUs (Not the Quadros and Tesla lines), NVENC encodes are limited to two simultaneous sessions. The sample below illustrates how to pass a list of AVI files to ffmpeg and encode them to HEVC on two encode sessions:

$ find Videos/ -type f -name \*.avi -print | sed 's/.avi$//' |\
  xargs -n 1 -I@ -P 2 ffmpeg -i "@.avi" -c:a aac -c:v hevc_nvenc "@.mp4"

This will find all files with the ending .avi in the directory Videos/ and transcode them into HEVC/H265+AAC files with the ending .mp4. The noteworthy part here is the -P 2 to xargs, which starts up to two processes in parallel.

@JohnPreston
JohnPreston / install_ffmpeg_amzn_linux.sh
Last active August 27, 2017 23:37
Script to install FFPMpeg on Amazon Linux - Centos
#!/usr/bin/env bash
if ! [ "$#" -eq 1 ]; then
echo "Usage: install_ffmpeg_amzn_linux.sh build_directory"
exit 1
fi
CPU_THREADS=`cat /proc/cpuinfo | grep processor | tail -1 | awk '{print $NF}'`
ROOT_DIR=$1
SOURCES_DIR=$ROOT_DIR/ffmpeg_sources
/* OctoWS2811 - High Performance WS2811 LED Display Library
http://www.pjrc.com/teensy/td_libs_OctoWS2811.html
Copyright (c) 2013 Paul Stoffregen, PJRC.COM, LLC
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: