Skip to content

Instantly share code, notes, and snippets.

View moshest's full-sized avatar

Moshe Simantov moshest

View GitHub Profile
@moshest
moshest / ffmpeg-cheatsheet.md
Created April 6, 2017 08:56 — forked from nickkraakman/ffmpeg-cheatsheet.md
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@moshest
moshest / quine.js
Last active September 7, 2017 07:07
A JavaScript function that reproduce itself as a Quine program
/**
* A JavaScript function that reproduce itself as a Quine program.
* Copyright (c) 2017 Moshe Simantov
*/
const assert = require('assert');
const quine = (function () {
var f = '(function () {%0A var f = %27@%27;%0A%0A return eval(unescape(f).replace(/@/, f));%0A})';
@moshest
moshest / alac2aac.bat
Created May 21, 2017 07:54
Convert alac to aac with ffmpeg
if not exist "output" mkdir output
for /r path %%var in (*.m4a) do ffmpeg -i %%var -c:a libfdk_aac -b:a 320k output\%%var.m4a
@moshest
moshest / split.bat
Created April 23, 2017 08:43
Split S1 .Mov files to folders
@echo off
set found=0
setlocal enabledelayedexpansion
for /L %%a in (start,1,9999) do (
set "num=%%a"
set "num=!num:~-4!"
if exist "ZCAM!num!_*.MOV" (
set found=1
echo "Create and move files to folder '%%num'"
@moshest
moshest / es6-methods.js
Created September 10, 2016 21:43
ES6 methods implementation
class Foo {
test() {
return 'Foo';
}
}
class Bar extends Foo {
test() {
return `${super.test()}Bar`;
}
sudo yum install epel-release
sudo yum install nginx
#mkdir cert && cd ./cert
#openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr
sudo /etc/init.d/nginx start
update-rc.d nginx defaults
#nano /etc/nginx/nginx.conf
@moshest
moshest / install-nodejs.sh
Last active March 14, 2016 09:38
Script for installing Node.js instance on Amazon AWS via user-data field & bitbucket.org
#!/usr/bin/env bash
set -e
NODE_ENV=production
GIT_HOSTNAME=bitbucket.org
GIT_PATH=username/project.git
GIT_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----"
INSTALL_SCRIPT=install.sh
@moshest
moshest / ubuntu utils.sh
Last active December 31, 2015 06:33
Ubuntu Usful command lines
# generate private and public keys
ssh-keygen -f ~/.ssh/id_rsa -q -P ""
cat ~/.ssh/id_rsa.pub
# add some public keys
nano ~/.ssh/authorized_keys
## install basic packages
sudo apt-get -y update
sudo apt-get -y install default-jre git ImageMagick
ul.tagit {
padding: 1px 5px;
overflow: auto;
margin-left: inherit; /* usually we don't want the regular ul margins. */
margin-right: inherit;
}
ul.tagit li {
display: block;
float: left;
margin: 2px 5px 2px 0;
Verifying I am +moshes on my passcard. https://onename.com/moshes