Skip to content

Instantly share code, notes, and snippets.

@git-thinh
git-thinh / README.md
Created June 6, 2024 10:41 — forked from ilblog/README.md
Create mp4 video from set of images in the browser client side, using ffmpeg.js in worker thread
@git-thinh
git-thinh / README.md
Created June 6, 2024 10:16 — forked from veltman/README.md
Gif rendering - SVG to GIF

Testing in-browser gif generation from an SVG with gif.js. Works in recent Chrome/Safari/Firefox.

Process:

  1. Create a standard SVG line chart.
  2. Step through in-between frames of the line chart: for each one, update the SVG, render to an image, add the image element to a stack of gif frames.
  3. Render frames together in the background using gif.js web workers.
  4. When rendering's complete, add the blob URL as an image and start the SVG on an infinite loop with d3.timer (gratuitous).

See also: Gif Globe, Gif New Jersey

@git-thinh
git-thinh / IIS_Verbs.config
Created May 16, 2024 09:15 — forked from jalalhejazi/IIS_Verbs.config
CORS: Web.config to enable CORS
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*"/>
<add name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE,OPTIONS"/>
<add name="Access-Control-Allow-Headers" value="Content-Type"/>
</customHeaders>
</httpProtocol>
Portable Node.js and NPM on Windows
1. Download the node.exe stand-alone from nodejs.org
https://nodejs.org/download/release/latest/win-x64/
https://nodejs.org/download/release/latest/
2. Grab an NPM release zip off of github
https://github.com/npm/npm/releases
3. Create a folder named: node_modules in the same folder as node.exe
4. Extract the NPM zip into the node_modules folder
5. Rename the extracted npm folder to npm and remove any versioning ie: npm-3.3.4 –> npm.
@git-thinh
git-thinh / MSYS
Last active January 29, 2018 07:58
pacman -Syuu
pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain \
cmake make curl tar unzip git subversion mercurial \
mingw-w64-i686-cmake mingw-w64-x86_64-cmake
pacman -Ss boost
pacman -Sy mingw-w64-i686-boost mingw-w64-x86_64-boost
pacman -Sy mingw-w64-i686-protobuf mingw-w64-x86_64-protobuf
pacman -Sy mingw-w64-i686-grpc mingw-w64-x86_64-grpc
@git-thinh
git-thinh / Ubuntu
Last active January 28, 2018 11:06
WSL:
# apt install build-essential autoconf libtool cmake make tar unzip shtool automake patch curl wget golang perl git pkg-config
apt-get install gcc-mingw-w64
Ubuntu
# apt install build-essential autoconf libtool cmake make tar unzip libgflags-dev libgtest-dev clang libc++-dev shtool automake patch curl wget golang perl yasm git pkg-config
git clone --recursive https://github.com/grpc/grpc.git
# install toolchain
#$ sudo apt-get install gcc-4.9-locales mingw32 mingw-w64 mingw-w64-tools \
# binutils-mingw-w64 binutils-mingw-w64-x86-64 binutils-mingw-w64-i686 \
# mingw-w64-x86-64-dev mingw-w64-i686-dev
# install autotools
#$ sudo apt-get install autoconf automake autotools-dev
# make sure environment variables are set
#-----------------------------
#edit file /../home/../.bashrc
alias c='cd /cygdrive/c'
alias home='cd ~'
alias code='cd /cygdrive/c/code'
alias addr2line='/bin/x86_64-w64-mingw32-addr2line.exe'
alias ar='/bin/x86_64-w64-mingw32-ar.exe'
$ PATH=$PATH:/c/cygwin/bin
$ mkdir .build && cd .build
$ git clone --recursive https://github.com/google/protobuf.git
$ git submodule update --init
$ PATH=$PATH:/c/msys2/mingw64/bin
$ PATH=$PATH:/c/msys2/mingw64/bin