Skip to content

Instantly share code, notes, and snippets.

View moshest's full-sized avatar

Moshe Simantov moshest

View GitHub Profile

Exmaple of a page break


another page

@moshest
moshest / ts-error.ts
Created March 29, 2020 14:30
Funval demo ts error
import { Schema, Optional, Or, Type } from 'funval';
const UserSchema = {
name: Optional(String),
status: Or('active' as 'active', 'suspended' as 'suspended'),
};
const validator = Schema(UserSchema);
let user: Type<typeof UserSchema>;
try {
@moshest
moshest / dynamic-lang.md
Last active February 29, 2020 15:26
A POC for Dynamic Syntax Language

Dynamic Syntax Language (POC)

I had an idea, creating a programming language with a dynamic syntax. Meaning, every programmer can extend the language easily and implement syntactic sugars fast.

Example Usage

import { createUseStyles } from 'react-jss';

// use native css styles with your code
@moshest
moshest / medium.txt
Created April 23, 2018 07:56
Keyuno articles
Link: https://medium.com/@keyuno/constructing-universal-map-of-knowledge-7fcd03a084d9
Key Uno, https://keyuno.github.io/masterkey/
Aug 29, 2017
Constructing Universal Map Of Knowledge
By designing a system of economic incentives that will provide access to reliable information to anyone with an internet connection.
Structure:
The universal map of knowledge consists of two parts:
@moshest
moshest / outputs.txt
Last active April 12, 2018 09:22
Node.js Performance Comparison Between SHA-512 and SHA-256
# MacBook Pro (Mid 2015) - 2.5 GHz Intel Core i7
# Node.js v9.2.0
block size: 8192
hashing sha512 x 300000 times: 4447ms
hashing sha256 x 300000 times: 6105ms
difference: 27.158067158067155 %
block size: 4096
hashing sha512 x 300000 times: 2601ms
@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 / 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 / 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`;
}