Skip to content

Instantly share code, notes, and snippets.

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

Nicolas Iderhoff niderhoff

:octocat:
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
niderhoff / extract_frames.py
Created Jun 12, 2018
Extract Frames from Video using OpenCV
View extract_frames.py
"""Extract frames from video using opencv.
"""
import os
import sys
import cv2
def main():
videopath = sys.argv[1]
@niderhoff
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
niderhoff / tmux.sh
Created Apr 9, 2018
create multiple tmux panes from bash script
View tmux.sh
#!/bin/bash
SESSIONNAME="niid"
STARTDIR="/home/niid/Documents/Projects"
tmux has-session -t apr &> /dev/null
if [ $? != 0 ]
then
tmux new-session -s $SESSIONNAME -c $STARTDIR/TCM -n "jptr" -d
tmux send-keys -t $SESSIONNAME:0 "source activate TCM" C-m
@niderhoff
niderhoff / keybindings.json
Created Nov 28, 2017
vscode-keybindings-windows
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
niderhoff / settings.json
Last active Nov 28, 2017
vscode-settings-windows
View settings.json
{
"workbench.colorTheme": "One Dark Pro",
"terminal.integrated.shell.windows": "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
#j::
IfWinActive, Skype
{
WinMinimize, Skype
@niderhoff
niderhoff / GitHub-Forking.md
Created Nov 17, 2017 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow
View GitHub-Forking.md

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

View mail-external-ip.py
import os, requests
TO = ''
IP = requests.get('https://icanhazip.com/').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
#parameters
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")
library(devtools)
### Step 2. Set configuration for our proxy (Please update your information proxy)
library(httr)
set_config(
use_proxy(url="18.91.12.23", port=8080, username="user",password="password")
You can’t perform that action at this time.