Skip to content

Instantly share code, notes, and snippets.

View niderhoff's full-sized avatar
: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.
View GitHub Profile
@scarlson
scarlson / playlist.sh
Last active June 15, 2024 02:35
Bash script to create .m3u playlist files for all mp3s in subdirectories
#!/bin/bash
#
# bash script to create playlist files in music subdirectories
#
# Steve Carlson (stevengcarlson@gmail.com)
find . -type d |
while read subdir
do
rm -f "$subdir"/*.m3u
@jaseemabid
jaseemabid / git tutorials.md
Last active March 24, 2024 00:07 — forked from netroy/git tutorials.md
Awesome git tutorials I am finding here and there
@marcschwartz
marcschwartz / Measures.R
Last active June 19, 2023 04:03
R Code for miscellaneous measures of association
####################################################################
#
# All Code and Comments Below (except code provided by Boris Mayer) are
# Copyright Marc Schwartz
# e-mail: marc_schwartz@me.com
# This code is made available under the GNU Public License V2.0
# This is free software and comes with ABSOLUTELY NO WARRANTY.
#
####################################################################
@willurd
willurd / web-servers.md
Last active July 23, 2024 12:11
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@hersonls
hersonls / .zshrc
Created February 26, 2016 17:35
Auto load python virtual env and rename tmux window using zsh
# chpwd is a zsh hook, wich is executed after change directory
# More info: http://zsh.sourceforge.net/Doc/Release/Functions.html
function chpwd() {
if [ -z "$VIRTUAL_ENV" ]; then
# If exists a virtualenv with name of directory, load it!
workon ${PWD##*/} 2> /dev/null
else
# If a virtual env are loaded, rename window with they name
TMUX_WINDOW_NAME=$(tmux display-message -p '#W')
if [ $TMUX_WINDOW_NAME != ${VIRTUAL_ENV##*/} ]; then
@mrbar42
mrbar42 / README.md
Last active July 6, 2024 23:08
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@matthiassb
matthiassb / dns-sync.sh
Last active July 3, 2024 23:29
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
[alias]
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
rms = !"git rm --cached $(git ls-files --deleted)"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
@oshliaer
oshliaer / readme.md
Last active December 9, 2022 13:57 — forked from NileDaley/repos.md
Change `cd` directory to the git repository using fzf (fuzzy search)

A git repositories finder on fzf

I use this little function (repo) on the command line to allow me to switch between different repositories easily using fzf

Prerequisits

  • fzf
  • zsh or bash

Installation