Skip to content

Instantly share code, notes, and snippets.

multidis /
Last active Aug 24, 2020
Cut a portion of video file by timestamps without re-encoding.
## starting second (7) to ending timestamp (06:05:00)
ffmpeg -ss 7 -i input.mkv -to 06:05:00 -c copy output.mkv
multidis /
Created Feb 29, 2020 — forked from gene1wood/
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7

This gist contains lists of modules available in

in AWS Lambda.

It also contains the code to run in Lambda to generate these lists. In addition there is a less_versbose module in the code that you can call to get a list of the top level modules installed and the version of those modules (if they contain a version

import pandas as pd
import math
import os.path
import time
from bitmex import bitmex
from binance.client import Client
from datetime import timedelta, datetime
from dateutil import parser
from tqdm import tqdm_notebook #(Optional, used for progress-bars)
multidis /
Created Feb 27, 2019 — forked from sloria/
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General


  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
multidis / Main.cs
Created Feb 15, 2018
QuantConnect Crypto GDAX CashBuyingPower SetHoldings issue
View Main.cs
// QuantConnect Crypto GDAX CashBuyingPower SetHoldings issue
using NodaTime;
namespace QuantConnect
public class ExampleAlgorithm : QCAlgorithm
private const string UnderlyingTicker = "BTCUSD";
private const string UnderlyingCoin = "BTC";
// slippage: NEED it for BTC
multidis / R_personal_lib_fix
Created Jul 3, 2017
`$HOME/.Renviron` content to fix inability of creating personal library repository in R 3.4.1
View R_personal_lib_fix
## check with `.libPaths()` in R-session.
View optim_time_memalloc_issue.jl
using Optim
## try commenting out the log in this line, Optim src/problems/univariate.jl:
## p18(x) = x <= 3.0 ? (x-2.0)^2 : 2.0###*log(x-2.0)+1.0
function frunmap(nmap::Int64, nmat::Int64)
M = randn(nmat, nmat)
# closure to parallel-apply
function fmaploc(vi)
# not doing anything here
multidis / pmap_optim_time.jl
Created Sep 29, 2016
Timing pmap calls involving Optim.jl in Julia versions 0.4 vs. 0.5.
View pmap_optim_time.jl
## timing pmap with Optim calls inside the function being applied
using Optim
@everywhere foptimtry(fobj::Function) = try
# fminbox local search: conjugate gradient
Optim.optimize(Optim.DifferentiableFunction(fobj), zeros(2), -10*ones(2), 10*ones(2),
# outer loop: bounds barrier
iterations = 200,
# inner loop: each optimizer run
multidis / Ledger_3_commands.dat
Created May 24, 2016 — forked from agaviria/Ledger_3_commands.dat
Collection of ledger-cli commands
View Ledger_3_commands.dat
# comments example for .dat or .ledger files
; This is a single line comment,
# and this,
% and this,
| and this,
* and this.
# If you have a deeply nested tree of accounts,
# it may be convenient to define an alias, for example:
multidis /
Last active Dec 23, 2015
Node.js providing `node` and `npm` commands on Ubuntu 14.04.
# use Node.js-maintained repositories
curl -sL | sudo bash -
sudo apt-get install nodejs
# update npm
sudo npm install --global npm@latest
# verify
node --version