Skip to content

Instantly share code, notes, and snippets.

@dmlaziuk
dmlaziuk / stash_dropped.md
Created April 14, 2021 11:12 — 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.

@dmlaziuk
dmlaziuk / config.js
Created February 27, 2020 21:35 — forked from codediodeio/config.js
Snippets from the Firestore Data Modeling Course
import * as firebase from 'firebase/app';
import 'firebase/firestore';
var firebaseConfig = {
// your firebase credentials
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
@dmlaziuk
dmlaziuk / gist:607b8e5df81497fd69c43ea2ab8a56bd
Created December 24, 2018 19:22
CSS properties for SVG
## FILL ##
fill Sets fill color of the shape.
fill-opacity Sets fill opacity of the shape.
fill-rule Sets fill rule of the shape.
** example **
fill: #ccc;
fill: rgba(0,0,0,.5);
fill: red;
@dmlaziuk
dmlaziuk / rm-python.sh
Created June 24, 2018 20:39
remove python
cd /usr/local/bin/
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDwP+8u9iEdwv0mJlZUfSDGL78GczTWDrpxaCf7Xd8sZ4Ci0NWyTYzPwyPLOWx+Z95tYIy/hux8Yv42m+kHsgUXKWH5nCnxEIzH/paQczVxa4J8nmZVYuIq7BrODVnVK4UHHhuKtT9uWnZtCcngmvgwE556gcR1HfvE9+HeTWLiTrnPrrCbOte7Q8KVlemj/XvHaSVxm1CwBlMLPzusppWqeioc7lPgJJfaVSMA5Mv8nFBenII4mALKnpLzWv0IYV8UOw8A9B2dWwDxntDeR2ecco7LwnW/RVWGHEoRKYEC33mr4Vs+plzBlRkwGiwLq/eLHmUcsBvPvBkaOeHdQe3z6G0r9UvQkn1lsTSXnCVCgomrNmviD9mmi4M1vVw5cZMrm7Hp3lSBLNsSsSMjS652vGek91udde02kExtR9fN1/TLbUAu9GtOJifQp4vOQXJ5ZWRegAA1fg9Bct4wF0VkPGmd0pj6ukttnC48HzBdY1M2PMVZ0Rt5TmapOkHvZaYc2GvKSM8qSJNedfOvVKh+FKh6UsGkqmrZcDChbP4oDapOoIDrd4S3Pl222Iqp94QfKFCM8DYbUMdaK4BEz4UmAPV4A7qdzfysVMXi98Mm8Suhr8WweXM8G49uuw1BSB+7ErieLyu5+r0y9lJSMOfVnU9It399Ef6e2QwIKoUPIw== [email protected]
@dmlaziuk
dmlaziuk / gitrmunreach.sh
Created February 12, 2018 11:24
Git remove unreachable commits and objects
#!/bin/sh
git fsck
git fsck --unreachable
git gc --prune=now
@dmlaziuk
dmlaziuk / gl.sh
Last active February 12, 2018 11:31
Git commit tree with all commits (including detached)
#!/bin/sh
git log --graph --decorate --all `git rev-list -g --all`
@dmlaziuk
dmlaziuk / RubyObjectModel.md
Last active April 4, 2021 18:56
Ruby Object Model

Ruby Object Model

Ruby version 2.4.1

BasicObject

 > BasicObject.public_instance_methods(false)
 => [:!, :==, :!=, :__send__, :equal?, :instance_eval, :instance_exec, :__id__]
@dmlaziuk
dmlaziuk / percent.rb
Last active September 22, 2018 13:19
%i used for array of symbols
%r used for regular expressions
%s used for symbols
%Q used for double-quoted strings
%q used for single-quoted strings
%W used for double-quoted array elements
%w used for single-quoted array elements
%x uses the ` method and returns the standard output of running the command in a subshell
puts "\e[H\e[2J"