Skip to content

Instantly share code, notes, and snippets.

View cpuguy83's full-sized avatar
🐶

Brian Goff cpuguy83

🐶
View GitHub Profile
@NicolasT
NicolasT / cryptosplice.c
Created May 10, 2016 17:52
Demonstration of splice, tee and AF_ALG hashing for zero-copy storage and data hash calculation
/* Usage:
*
* $ make cryptosplice
* cc cryptosplice.c -o cryptosplice
*
* $ rm -f cryptosplice.out
* $ ./cryptosplice
*
* Now, in another terminal:
*
@whistler
whistler / import.sh
Created March 16, 2015 17:31
Copy files to another repository while saving git history
# copied from http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
git clone <git repository A url> # clone source repository
cd <git repository A directory>
git remote rm origin # to make sure it doesn't affect the original repository
git filter-branch --subdirectory-filter <directory 1> -- --all # remove all files other than the ones needed
mkdir <directory 1> # move them into another directory where they will be stored in the destination repository (if needed)
mv * <directory 1>
git add .
git commit
@fred
fred / clockwork_celluloid.rb
Created June 28, 2013 17:16
Running clockwork inside a Sidekiq Thread using Celluloid
###
### Rails.root/lib/scheduler.rb
###
require 'celluloid/autostart'
module AwesomeRailsApp
class ClockworkScheduler
include Celluloid
include Clockwork
def run
@trongthanh
trongthanh / gist:2779392
Last active April 17, 2024 12:12
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: