Skip to content

Instantly share code, notes, and snippets.

View wyaeld's full-sized avatar
🐣
work in progress

Brad Murray wyaeld

🐣
work in progress
View GitHub Profile
@luizomf
luizomf / upscale_1080p_to_4k_using_ffmpeg.md
Last active June 22, 2024 06:07
Upscale 1080p to 4k using ffmpeg

Upscale 1080p to 4k using ffmpeg

Just use the command below:

ffmpeg -i INPUT_FILE \
  -vf scale=3840x2160:flags=lanczos \
  -c:v libx264 \
  -crf 13 \
 -c:a aac -b:a 512k \

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
@bbennett36
bbennett36 / crpto_profit_calc.py
Last active July 29, 2019 16:29
Take Profit/Stop Loss Profitability Calculator for Trading Crypto
import pandas as pd
import numpy as np
def test_cutoffs(start_amount, start_price, buy_fee, sell_fee, end_price):
bought_fee = start_amount*buy_fee
bought_amt = (start_amount-bought_fee) / start_price
sold = bought_amt*end_price
sold_fee = sold*sell_fee
sold = sold-sold_fee
@crpietschmann
crpietschmann / gencert.sh
Last active June 13, 2024 20:23
OpenSSL Generate 4096-bit Certificate (Public/Private Key Encryption) with SHA256 Fingerprint
# Generate Private Key and Certificate using RSA 256 encryption (4096-bit key)
openssl req -x509 -newkey rsa:4096 -keyout privatekey.pem -out certificate.pem -days 365
# Alternatively, setting the "-newkey" parameter to "rsa:2048" will generate a 2048-bit key.
# Generate PKCS#12 (P12) file for cert; combines both key and certificate together
openssl pkcs12 -export -inkey privatekey.pem -in certificate.pem -out cert.pfx
# Generate SHA256 Fingerprint for Certificate and export to a file
openssl x509 -noout -fingerprint -sha256 -inform pem -in certificate.pem >> fingerprint.txt
@francisrstokes
francisrstokes / StateDispatcher.js
Last active May 28, 2019 02:31
Redux without redux - sharing state and one way data flow using only standard react
import React from 'react';
export class StateDispatcher extends React.Component {
constructor(props) {
super(props);
this.state = props.state || {};
this._dispatch = this.dispatch.bind(this);
}
dispatch(action) {
@davideicardi
davideicardi / README.md
Last active March 8, 2023 15:05
Write and read Avro records from bytes array

Avro serialization

There are 4 possible serialization format when using avro:

@sergiobd
sergiobd / BatchConvertVideos.ps1
Last active June 12, 2024 13:40
Batch convert videos using ffmpeg and powershell
# Script to convert a list of files using ffmpeg and powershell. This example converts to .ogv files (theora/vorbis as video/audio codecs)
# Please note that, if you havent done so, you should set the execution policy of powershell in order to be able to run this script.
# The easiest way to run this script without messing to much with execution policies is to set it for a single powershell session:
# powershell.exe -ExecutionPolicy Unrestricted
# Check: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies
$filenames = "1","2", "3", "4", "5","6","7"
$filepath = "C:\Users\Oculus\Documents\Videos\Menu\"
$extension = ".mp4"
@chukaofili
chukaofili / echo-server.yml
Last active October 19, 2021 01:29
Echo Server Deployment
apiVersion: v1
kind: Namespace
metadata:
name: echoserver
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
namespace: echoserver
@elizarov
elizarov / Main.kt
Created March 9, 2018 10:05
Kotlin Coroutines, a deeper look
// Inspired by http://akarnokd.blogspot.ru/2017/09/rxjava-vs-kotlin-coroutines-quick-look.html
// Requires Kotlin 1.2.30 or later
// Uses kotlinx.coroutines library
import kotlinx.coroutines.experimental.*
import kotlin.system.*
suspend fun f1(i: Int): Int {
println("f1 attempt $i")
delay(if (i != 3) 2000 else 200)