Skip to content

Instantly share code, notes, and snippets.

All it takes to become a data scientist: 5 PhD's & 87 years of job experience.

Nicolas Iderhoff niderhoff

All it takes to become a data scientist: 5 PhD's & 87 years of job experience.
Block or report user

Report or block niderhoff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
niderhoff /
Created Jun 12, 2018
Extract Frames from Video using OpenCV
"""Extract frames from video using opencv.
import os
import sys
import cv2
def main():
videopath = sys.argv[1]
niderhoff / installcuda9_ubuntu.txt
Last active May 15, 2019
Install CUDA 9 + cudnn 7.1 on Ubuntu
View installcuda9_ubuntu.txt
# ----------------------------------------------------
# 1: NVIDIA Graphics Driver Installation
# ----------------------------------------------------
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-update
sudo apt install nvidia-384 nvidia-384-dev
# ----------------------------------------------------
# 2: Blacklist noveau-graphics-driver
niderhoff /
Created Apr 9, 2018
create multiple tmux panes from bash script
tmux has-session -t apr &> /dev/null
if [ $? != 0 ]
tmux new-session -s $SESSIONNAME -c $STARTDIR/TCM -n "jptr" -d
tmux send-keys -t $SESSIONNAME:0 "source activate TCM" C-m
niderhoff / keybindings.json
Created Nov 28, 2017
View keybindings.json
// Place your key bindings in this file to overwrite the defaults
"key": "ctrl+v",
"command": "pasteAndIndent.action",
"when": "editorTextFocus && !editorReadonly"
"key": "ctrl+v",
"command": "editor.action.clipboardPasteAction",
niderhoff / settings.json
Last active Nov 28, 2017
View settings.json
"workbench.colorTheme": "One Dark Pro",
"": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"window.menuBarVisibility": "toggle",
"window.zoomLevel": 0,
"workbench.startupEditor": "newUntitledFile",
"editor.minimap.enabled": true,
"editor.fontFamily": "Hack, Consolas",
"editor.renderWhitespace": "boundary",
"editor.cursorStyle": "line-thin",
View hotkeys.ahk
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
; SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetWorkingDir C:\Users\niid\Documents\Projects
IfWinActive, Skype
WinMinimize, Skype
niderhoff /
Created Nov 17, 2017 — forked from Chaser324/
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

import os, requests
TO = ''
IP = requests.get('').text
if IP != open('.ip').readlines()[1]:
open('.ip','w').write('Subject: New IP!\n'+IP)
os.system('cat .ip | sendmail '+TO)
View gist:ab8c7c82710423318eff8591d07386c0
import cv2, numpy as np, os
working_dir = '/home/stephen/Desktop/keras_demo/'
cap = cv2.VideoCapture(1)
org, font, scale, color, thickness, linetype = (50,50), cv2.FONT_HERSHEY_SIMPLEX, 1.2, (234,12,123), 2, cv2.LINE_AA
#chromakey values
h,s,v,h1,s1,v1 = 16,0,64,123,111,187 #green
h,s,v,h1,s1,v1 = 0,74,53,68,181,157 #skin tone
View r-install_github_with_proxy.R
### Step 1. Install devtools packages
if (!require("devtools")) install.packages("devtools")
### Step 2. Set configuration for our proxy (Please update your information proxy)
use_proxy(url="", port=8080, username="user",password="password")
You can’t perform that action at this time.