Skip to content

Instantly share code, notes, and snippets.

@nkcr
nkcr / Commands.rb
Last active August 21, 2018 09:18
Convert Video with ffmpeg
# ogv
$ ffmpeg -y -i movie.mov -vcodec libvpx -acodec libvorbis ffmpeg.webm
# normal mp4
$ ffmpeg -y -i movie.mov -vcodec libx264 -acodec libfaac -s 1920x1080 ffmpeg.mp4
# rescale
$ ffmpeg -ss 30 -y -i movie.mov -s 1920x1080 ffmpeg.png
# extract images
@nkcr
nkcr / GCStorage download
Last active November 24, 2015 09:45
Bash commands to download gcstorage objects
$ mkdir ~/Desktop/$(date +%Y-%m-%d)
$ gsutil -m cp -L ~/Desktop/pgsql/manifest.txt -R gs://backup-reseaujeunesse-ch/pgsql ~/Desktop
$ gsutil -m rm gs://backup-eebulle-ch/pgsql/* # no worry if it delets pgsql folder, it will be created automatically by backup script
$ gsutil ls gs://backup-reseaujeunesse-ch/pgsql | grep -v .*0207.sql.aes | gsutil -m rm -I
@nkcr
nkcr / pointers.c
Last active August 29, 2015 14:12
lonely C
//
// A pointer is ...
uint16_t * pointer; // will point on a 16 integer bit data (sizeof = 2 bytes)
//
//
// Write at reg @
//
volatile uint16_t * reg = (volatile uint16_t *) 1234; // 1234 is the @
*reg = 4321; // 4321 is the new value
@nkcr
nkcr / tech.md
Last active August 29, 2015 14:13
My tech

HTML / Javascript

  • Pixi.js
  • phaser

Databse

  • Cassandra
  • Orchestrate
  • Neo4J
@nkcr
nkcr / TE 3 - Algos.md
Last active August 29, 2015 14:19
Exam notes

Vocabulaire

  • Graphe connexe pas d'éléments non-reliés
  • Graphe acyclique sans cycle
  • Graphe complet tous les arcs possibles
  • Graphe bipartite 2 sous-graphes non-reliés entre eux
  • Arc avant, arrière arc qui remont/redescent
  • Arc transversal qui va à un autre arbre
  • Ensemble de sommets fortement connexe si il y a tous les arcs possible
  • DAG graphe dirigé acyclique
@nkcr
nkcr / places_data
Last active August 29, 2015 14:22
SO-sdfsdk
{
"infos" : {
"version" : "0.1",
"count" : 10,
},
"places" : {
"place" : {
"name" : "Imprévu",
"lat" : 10,
"lng" : 10,
require 'date'
# Actually doesn't matter WHAT you choose as the epoch, it
# won't change the algorithm. Just don't change it after you
# have cached computed scores. Choose something before your first
# post to avoid annoying negative numbers. Choose something close
# to your first post to keep the numbers smaller. This is, I think,
# reddit's own epoch.
$our_epoch = Time.local(2005, 12, 8, 7, 46, 43).to_time
gem build  blabla.gemspec
gem push blabla.gem

npm
@nkcr
nkcr / opencv.md
Last active January 22, 2022 17:06
Install opencv on mac

Install opencv3 with brew

brew tap homebrew/science
brew install opencv3

Be sure to have pkg-config, otherwise install it:
brew install pkg-config

be sure to have pkg-config var set correctly

@nkcr
nkcr / fast rsync.md
Last active February 25, 2016 21:04

rsync version 3.1.2

rsync -a --progress --stats --human-readable -e "ssh -T -c arcfour -o Compression=no -x" <source> <destination>

https://gist.github.com/KartikTalwar/4393116

  • -a archive mode
  • --progress --human-readable show progress in readble manner