Skip to content

Instantly share code, notes, and snippets.

View zfarbp's full-sized avatar
👽
Talking to /dev/null

Fabian Bienk zfarbp

👽
Talking to /dev/null
View GitHub Profile
@zfarbp
zfarbp / gist:e07ee9141f92156cb3a34af58da41362
Last active September 21, 2019 08:58
Javascript: Handling time zone problem
function now() {
const tzoffset = new Date().getTimezoneOffset() * 60;
return (new Date(Date.now()/1000 - tzoffset)).getTime();
}
@zfarbp
zfarbp / gist:20fa23c7153e4817342a8304b47bcacd
Last active September 21, 2019 08:59
Javascript: Array: push obj to the end of array
array.push(array.splice(array.indexOf(obj), 1)[0]);
@zfarbp
zfarbp / gist:64fc20c7f100943ae9f38d4c46e23cf9
Last active September 21, 2019 08:59
Bash: Cut/Download part of video via ffmpeg
#!/bin/bash
VID_URL=$1
VID_OUT_PATH=$2
START_TIME=$3
DURATION_TIME=$4
ffmpeg -ss $START_TIME -i $VID_URL -to $DURATION_TIME -vcodec copy -acodec copy -avoid_negative_ts make_zero $VID_OUT_PATH
# Genrate keys
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
-----------------------------------------------------------
# Edit ~/.ssh/config
Host your.hostname.com
Hostname github.com
@zfarbp
zfarbp / vscodeextensions.md
Last active October 1, 2019 22:05
Visual Code - Backup List of Installed Extensions, Settings and Keybindings

Visual Code - Backup List of Installed Extensions, Settings and Keybindings

List Extensions

Set VS Code Path

Open the Command Palette (⇧⌘P) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.

List installed extensions (+Install Statement)

@zfarbp
zfarbp / vscodesettingsbackup.md
Created October 2, 2019 07:50
My Visual Code Extensions,Settings and Keybindings Backup

My Visual Code Extensions,Settings and Keybindings Backup

Settings

{
    "workbench.colorTheme": "Flatland Monokai",
    "explorer.confirmDelete": false,
    "javascript.updateImportsOnFileMove.enabled": "always",
    "javascript.referencesCodeLens.enabled": true,
@zfarbp
zfarbp / gist:c34ef6a29c74837dd7ec4da11194e18e
Created October 24, 2019 01:59
Cross compiling Golang applications for Raspberry Pi
env GOOS=linux GOARCH=arm GOARM=5 go build <file>
@zfarbp
zfarbp / l.sh
Last active October 30, 2019 23:10
Searching for Dead Symbolic Links
#!/bin/bash
find . -type l -print | perl -nle '-e || print'
@zfarbp
zfarbp / gist:f4d28db1b6a4309389d484f47fedb748
Created November 19, 2019 12:06
youtube-dl best quality
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' https://www.youtube.com/watch?v=SLOBmN2iN60
@zfarbp
zfarbp / zfarbp_lightline_theme.vim
Last active March 15, 2020 21:33
zfarbp_lightline_theme
" =============================================================================
" Filename: autoload/lightline/colorscheme/zfarbp_lightline_theme.vim
" Author: zfarbp
" License: MIT License
" Last Change: 2020/03/15
" =============================================================================
" color definitions
" [ "gui", cterm ]
let s:base03 = [ '#242424', 235 ]