Skip to content

Instantly share code, notes, and snippets.

Avatar

Maksim Surguy msurguy

View GitHub Profile
@msurguy
msurguy / README.md
Last active Jan 8, 2020
Make QR Code for Chrome URL
View README.md

An Apple Script for quickly generating qr code for the URL of the front-most Chrome window.

Instructions:

  1. Install qrcode Node package globally by
npm install -g qrcode
  1. Download qrcode.scpt provided here
  2. Make the script into an app by opening qrcode.scpt in Script Editor, then File > Export > File Format : Application and save it to your Applications.
@msurguy
msurguy / ffmpeg.md
Created Nov 4, 2019 — forked from dvlden/ffmpeg.md
Convert video files to MP4 through FFMPEG
View ffmpeg.md

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
View actions.yml
// Slack action:
https://github.com/Ilshidur/action-slack
args = "tag v*"
tags:
- v1 # Push events to v1 tag
- v1.0 # Push events to v1.0 tag
View gist:bd036dda5ff44d8d6a4c94070b6e386c
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:
View basic-auth-module.js
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 Jul 21, 2019 — forked from alexellis/timelapse.md
ffmpeg time-lapse
View timelapse.md

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
timelapse video from GoPro Hero photos
View readme.md
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 Apr 9, 2019
Jetson Nano OpenCV 4.0.0 install script
View opencv_install.sh
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <Install Folder>"
exit
fi
folder="$1"
user="nvidia"
passwd="nvidia"
@msurguy
msurguy / about.md
Created Apr 8, 2019 — forked from mattdesl/about.md
A Browser and Node.js compatible canvas-sketch script for generative and parametric 3D geometry.
View about.md

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 Mar 29, 2019
Pythoin File downloader
View downloader.py
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:
You can’t perform that action at this time.