Skip to content

Instantly share code, notes, and snippets.

View rezof's full-sized avatar

monssef rezof

  • morocco
View GitHub Profile
@rezof
rezof / gist:2ccaedb2346e8ee2a5f27887ed8c25e5
Last active February 20, 2017 08:19 — forked from marty-wang/gist:5a71e9d0a6a2c6d6263c
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@rezof
rezof / deregister.sh
Created July 20, 2017 18:57 — forked from bpholt/deregister.sh
Stop tasks on ECS Container Instance and Deregister it from ECS Cluster
#!/bin/bash
cluster=default
container_instance= # container instance guid
tasks=$(aws --region us-west-2 ecs list-tasks --container-instance $container_instance --cluster $cluster | jq -r '.taskArns | map(.[40:]) | reduce .[] as $item (""; . + $item + " ")')
for task in $tasks; do
aws --region us-west-2 ecs stop-task --task $task --cluster $cluster
done
aws --region us-west-2 ecs deregister-container-instance --cluster $cluster --container-instance $container_instance
@rezof
rezof / .block
Last active September 4, 2017 13:58 — forked from mbostock/.block
Zoom to Domain
license: gpl-3.0
@rezof
rezof / subtitle-extract.txt
Created January 16, 2018 17:00 — forked from bmaeser/subtitle-extract.txt
extract subtitles from *.mkv-files on osx
lines with $ are commands
### install mkvtoolnix:
$ brew install mkvtoolnix
### list content of the mkv-file:
$ mkvmerge -i mymoviefile.mkv
### what will give you:
@rezof
rezof / mp4
Created November 20, 2018 17:28
#!/bin/bash
nohup ffmpeg -i $1 -vcodec copy -strict -2 -ac 2 $1".mp4" &
@rezof
rezof / gist:7f881c9035d52cd272e5b340664dcec1
Last active June 12, 2022 10:50
glsl helper functions
float drawPolygon(const vec2 polygonCenter, const int N, const float radius, vec2 pos) {
pos = pos - polygonCenter;
float d = 0.0;
float a = atan(pos.x, pos.y);
float r = TWO_PI / float(N);
d = cos(floor(0.5 + a / r)*r - a)*length(pos);
return (1.0 - smoothstep(radius, radius + radius/10.0, d));
}
@rezof
rezof / random-grid-generator.js
Created December 29, 2022 21:04
generate a grid made of randomly sized rectangles
const grid = {};
const rectangles = [];
const rows = 50;
const cols = 50;
// mark all columns as un-claimed
for (let r = 0; r < rows; r++) {
for (let c = 0; c < cols; c++) {
grid[`${r}-${c}`] = { claimed: false };