Skip to content

Instantly share code, notes, and snippets.

@dseeni
dseeni / git-notes.mdown
Created May 5, 2019 17:22 — forked from JadedEvan/git-notes.mdown
Library of useful git commands

Git Notes

Merge Two Branches in seperate repos

I have two independent repositories (A and B) and would like to merge one repo. (B) into another one (A) with keeping the whole history of both. What do to?

% cd projectA
% git remote add test ../path/to/other/repo && git fetch test

Adds a new branch called test which pulls in ALL branches from the /other/repo. git fetch test pulls code for all branches

@dseeni
dseeni / stash_dropped.md
Created May 5, 2019 19:46 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits:

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

@dseeni
dseeni / cols.txt
Created May 5, 2019 19:47 — forked from 0/cols.txt
Brief awk tutorial
abc 1 2 3
def 4 5 6
ga 7 9 10
hij 1 5 99
@dseeni
dseeni / 01.bash_shortcuts_v2.md
Created May 7, 2019 05:34 — forked from tuxfight3r/01.bash_shortcuts_v2.md
Bash keyboard shortcuts

Bash

Moving

command description
ctrl + a Goto BEGINNING of command line
ctrl + e Goto END of command line
ctrl + b move back one character
@dseeni
dseeni / gitflow-breakdown.md
Created May 7, 2019 16:25 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

#!/usr/bin/env ruby
def format_commit_info timestamp, time_desc, commit_id, message, ref_name
[
"#{timestamp.strftime("%y %b %d")}, #{timestamp.strftime("%l:%M%p").downcase}",
"(#{time_desc})",
commit_id,
message,
ref_name
]
@dseeni
dseeni / LRUCache
Created May 24, 2019 00:06 — forked from krishankant/LRUCache
LRUCache Implementation
package com.learning;
/* package whatever; // don't place package name! */
import java.util.HashMap;
class Entry {
int value;
int key;
Entry left;
Entry right;
@dseeni
dseeni / 00_blot3.md
Created June 28, 2019 07:15 — forked from keijiro/00_blot3.md
KodeLife fragment shader sketch

gif

@dseeni
dseeni / description.md
Created August 1, 2019 03:42 — forked from smhanov/description.md
Pipeline multiprocessing for python with generators

Pipeline multiprocessing in Python with generators

Similar to mpipe, this short module lets you string together tasks so that they are executed in parallel.

The difference is that it lets you use generators, functions which yield results instead of returning them. Each yielded item gets passed to the next stage.

You can specify that one or more copies of the workers operate on the input queue.

Things that can be in a stage