Skip to content

Instantly share code, notes, and snippets.

View corenel's full-sized avatar
💭
I may be slow to respond.

Yusu Pan corenel

💭
I may be slow to respond.
View GitHub Profile
@underhilllabs
underhilllabs / git-split-subpath.bash
Created March 3, 2012 19:14
Split a subtree of a git repository into a separate repo.
#########################################################
#
# classes is a git repository with many class projects
# I want to split one of those projects into its own repo
# and I want preserve the commit history
#
# The super top-level repo is classes.git
# Within classes.git is a sub-directory "networks/project2"
# we want to create a new repository with just the history of
# "networks/project2"
@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@burke
burke / remotepaste.md
Last active September 26, 2023 11:04
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@ShigekiKarita
ShigekiKarita / matrix_util.hpp
Last active November 12, 2021 12:44
Eigen serialization
#ifndef matrix_utils_hpp
#define matrix_utils_hpp
#include <vector>
#include <array>
#include <type_traits>
#include <fstream>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>

Offline Python Package Install Notes

Two common cases which make the install of Python packages harder due to networking issues are: a) Install behind a Proxy b) Install without access to the internet

(a) Install behind a Proxy

In the case where the target machine connects to the internet over a network proxy, export the following environment vars, as appropriate - http_proxy and https_proxy. Eg:

@zchee
zchee / actionlist.vim
Last active April 19, 2024 13:22
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@justinledwards
justinledwards / camerasettings.sh
Created September 17, 2015 23:12
Camera settings on v4l2
#!/bin/bash
v4l2-ctl -c brightness=0
v4l2-ctl -c contrast=120
v4l2-ctl -c white_balance_temperature_auto=0
v4l2-ctl -c gamma=120
v4l2-ctl -c white_balance_temperature=4700
v4l2-ctl -c sharpness=100
v4l2-ctl -c backlight_compensation=0
v4l2-ctl -c focus_absolute=10
v4l2-ctl --list-ctrls-menus
@theothermattm
theothermattm / sync-using-gitignore.sh
Created October 7, 2015 20:58
Rsync files using .gitignore
# sync everything excluding things in .gitignore
# delete anything on target not in source
# include dotfiles and symlinks, also use compression
rsync -azP --delete --filter=":- .gitignore" . my-target-host:/my/target/directory
@yohhoy
yohhoy / ff2cv.cpp
Last active April 12, 2024 06:49
Read video frame with FFmpeg and convert to OpenCV image
/*
* Read video frame with FFmpeg and convert to OpenCV image
*
* Copyright (c) 2016 yohhoy
*/
#include <iostream>
#include <vector>
// FFmpeg
extern "C" {
#include <libavformat/avformat.h>
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm