Skip to content

Instantly share code, notes, and snippets.

View Foxtrod89's full-sized avatar
🏠
Working from home

Alex Foxtrod89

🏠
Working from home
View GitHub Profile
@addiversitas
addiversitas / ivFullCode.R
Created October 18, 2020 16:12
full code example for implied volatility surface
#load packages
library(quantmod)
library(rvest)
library(reshape2)
library(plotly)
library(akima)
#get underlying stock info and last trade date
symbol <- "AAPL"
priceInfo <- getQuote(symbol)
@cheadrian
cheadrian / Youtube_Livestream_Parts_download.py
Last active January 18, 2022 21:08
Download Youtube Live streamed video from the start or selected time
#With the help of this script you can download parts from the Youtube Video that is live streamed, from start of the stream till the end
import urllib.request
import os
#E.G: "https://r4---sn-gqn-p5ns.googlevideo.com/videoplayback?expire=1603041842& ..... 2.20201016.02.00&sq="
#The sound link should contain: &mime=audio in it.
#Here's an example from NASA LIVE:
#VIDEO: https://r5---sn-gqn-p5ns.googlevideo.com/videoplayback?expire=1603165657&ei=eQmOX8TeFtS07gO1xLWwDA&ip=79.115.11.159&id=DDU-rZs-Ic4.1&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160&source=yt_live_broadcast&requiressl=yes&mh=PU&mm=44%2C29&mn=sn-gqn-p5ns%2Csn-c0q7lnsl&ms=lva%2Crdu&mv=m&mvi=5&pl=20&initcwndbps=1350000&vprv=1&live=1&hang=1&noclen=1&mime=video%2Fmp4&gir=yes&mt=1603143920&fvip=5&keepalive=yes&fexp=23915654&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Clive%2Chang%2Cnoclen%2Cmime%2Cgir&sig=AOq0QJ8wRQIgQMnxy1Yk3HLTpqbOGmjZYH1CXCTNx6u6PgngAVGi4EQCIQDWyaye-u_KGyVQ0HRUsyKVaAzyXbmzDqOGVGpIyP7VtA%3D%3D&lspa
function gen_ssl_cert {
local prefix="${1}"
openssl genrsa -des3 -out "${prefix}.lock.key" 1024
openssl rsa -in "${prefix}.lock.key" -out "${prefix}.key"
rm "${prefix}.lock.key"
openssl req -new -key "${prefix}.key" -out "${prefix}.csr"
openssl x509 -req -days 3650 -in "${prefix}.csr" -signkey "${prefix}.key" -out "${prefix}.crt"
openssl pkcs12 -export -inkey "${prefix}.key" -in "${prefix}.crt" -out "${prefix}.pfx"
@nimahkh
nimahkh / addSRT2MKV.sh
Last active October 26, 2023 22:40
add srt subtitle into mkv video with FFMPEG- put all off your mkv and srt files with same names ina folder and run sh command. all of the converted files will be in the added folder inside the current folder.
#!/bin/bash
#author: nima.2004hkh@gmail.com
#ffmpeg command from : https://gist.github.com/kurlov/32cbe841ea9d2b299e15297e54ae8971
NOCOLOR='\033[0m';
RED='\033[0;31m';
GREEN='\033[0;32m';
[ -d added ] || mkdir added
@JonathanLPoch
JonathanLPoch / nmap-diff.sh
Last active October 4, 2022 15:56
Lightweight Nmap Topology Scanning
#!/bin/sh
DEFAULTNMAPOPTIONS="-T4 -sV -Pn --top-ports 5000 -R"
NMAPOPTIONS="$DEFAULTNMAPOPTIONS"
die() {
printf '\033[38;5;9m%s\033[0m\n\n' "$1" >&2
display_usage
exit 1
}
@MaxXx1313
MaxXx1313 / Remove VK ads.js
Last active April 4, 2021 14:41
Remove promoted posts and ads on vk.com (tampermonkey script)
// ==UserScript==
// @name Remove VK ads
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Remove VK advertisement
// @author maxxx1313
// @match https://vk.com/*
// @grant none
// @runat document-end
// ==/UserScript==
@yoshyoshi
yoshyoshi / gist:5a35a23ac263747eabc70906fd037ff3
Last active September 1, 2021 14:42
download and store OHLCV data into a CSV
import alpaca_trade_api as tradeapi
api = tradeapi.REST(key_id=<your key id>,secret_key=<your secret key>)
storageLocation = "<your folder location>"
barTimeframe = "1H" # 1Min, 5Min, 15Min, 1H, 1D
assetsToDownload = ["SPY","MSFT","AAPL","NFLX"]
iteratorPos = 0 # Tracks position in list of symbols to download
assetListLen = len(assetsToDownload)
@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@Jiab77
Jiab77 / ffmpeg.md
Last active August 9, 2022 21:40
Compilation FFMpeg / NVENC + QSV + VAAPI + VDPAU + OpenCL

Compilation FFMpeg / NVENC + NVRESIZE + QSV + VAAPI + VDPAU + OpenCL

nVidia nvresize patch is outdated and not more compatible to the latest version of FFmpeg, so it's not included in this documentation.

(even if I've passed a lot of time at trying to make it compile... without any success)

Please don't rely on this page: https://developer.nvidia.com/ffmpeg, the implementation is a hack and was never been added to the main FFmpeg tree.

See:

@Brainiarc7
Brainiarc7 / nvenc-capabilities-ffmpeg.md
Last active October 10, 2023 23:26
See the supported NVENC and NPP capabilities in your FFmpeg build

Quickly check for supported NVENC and NPP hardware acceleration capabilities in FFmpeg on your platform:

Depending on how you built ffmpeg, you may want to check the supported NVENC-based hardware acceleration capabilities in ffmpeg by running:

$ for i in encoders decoders filters; do
    echo $i:; ffmpeg -hide_banner -${i} | egrep -i "npp|cuvid|nvenc|cuda|nvdec"
done

Sample output (as on my testbed):