Skip to content

Instantly share code, notes, and snippets.

View msurguy's full-sized avatar

Maksim Surguy msurguy

View GitHub Profile
@msurguy
msurguy / gist:bd036dda5ff44d8d6a4c94070b6e386c
Created August 28, 2019 04:28
zeit/now deploy actions
on: [push]
name: Deploy on Now
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: deploy
uses: actions/zeit-now@master
env:
@msurguy
msurguy / basic-auth-module.js
Created July 25, 2019 18:20
Nuxt.js Basic Auth
const { createMiddleware } = require('./basic-auth')
export default function (moduleOptions) {
const options = Object.assign({}, this.options.basic, moduleOptions || {})
const { name, pass, enabled } = options
if (!(name && pass)) {
console.log('name or pass not found. Skip registration of authentication server.')
return false
}
if (enabled === false) {
@msurguy
msurguy / timelapse.md
Created July 21, 2019 21:14 — forked from alexellis/timelapse.md
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

@msurguy
msurguy / readme.md
Created May 15, 2019 16:19
timelapse video from GoPro Hero photos
ffmpeg \
  -r 15000/1001 \
  -pattern_type glob -i '*.JPG' \
  -vf "crop=in_w:in_w*9/16,scale=3840:-2" \
  -sws_flags lanczos \
  -pix_fmt yuv420p \
  -vcodec libx264 \
  output2.mkv
@msurguy
msurguy / opencv_install.sh
Last active April 9, 2019 04:17
Jetson Nano OpenCV 4.0.0 install script
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <Install Folder>"
exit
fi
folder="$1"
user="nvidia"
passwd="nvidia"
@msurguy
msurguy / about.md
Created April 8, 2019 23:53 — forked from mattdesl/about.md
A Browser and Node.js compatible canvas-sketch script for generative and parametric 3D geometry.

Generative Geometry in Browser + Node.js

Here is a script that can be run with canvas-sketch to generate OBJ files from a parametric/algorithmic 3D ThreeJS geometry.

Hitting "Cmd + S" from the canvas-sketch tool will export a PNG and OBJ file of the scene.

If the same script is run from Node, it will simply render the OBJ to stdout, or write to the filename argument if given.

@msurguy
msurguy / downloader.py
Created March 29, 2019 05:58
Pythoin File downloader
import csv, sys
#import requests
import urllib.request
#from urllib.request import urlopen
import os
filename = 'test.csv'
with open(filename, mode='r', encoding='utf-8-sig') as f:
reader = csv.reader(f)
try:
@msurguy
msurguy / .block
Created February 22, 2019 07:36 — forked from getflourish/.block
D3 + Vue.js
license: mit
@msurguy
msurguy / bunny.go
Created November 18, 2018 09:27
3D line engine with UI
package main
import "github.com/fogleman/ln/ln"
import (
"net/http"
"io/ioutil"
"strconv"
"fmt"
)
@msurguy
msurguy / soundwave.pde
Created July 3, 2018 22:53
soundwave plotter
// Original : http://arch-2226-01.softlabnyc.com/class-1c-radial-sound-wave/
// Modified by Maksim Surguy to have constantly increasing diameter, different colors, more samples per second
import ddf.minim.*;
Minim minim;
AudioInput sound;
//set the buffer for the sound input:
//this is how many samples are taken per frame