Skip to content

Instantly share code, notes, and snippets.

View npenkov's full-sized avatar

Nick Penkov npenkov

View GitHub Profile
git push -d <remote_name> <branch_name>
git branch -d <branch_name>
@npenkov
npenkov / git-squash-all.sh
Created December 29, 2017 12:59
GIT Squash all commits alias
git config --global alias.squash-all '!f(){ git reset $(git commit-tree HEAD^{tree} -m "${1:-A new start}");};f'
@npenkov
npenkov / golang.gitlab-ci.yml
Created December 29, 2017 12:57
gitlab-ci for Go projects using go dep.
# Replace "projectname" and "username"
image: golang:1.9
variables:
BIN_NAME: projectname
ARTIFACTS_DIR: artifacts
GO_PROJECT: gitlab.com/username/projectname
stages:
- build
@npenkov
npenkov / gen.sh
Created July 22, 2016 13:54 — forked from mik01aj/gen.sh
#!/bin/bash
# Usage: ./gen.sh collected-stacks.txt
TMPSTACKS=/tmp/flamegraph-stacks-collapsed.txt
TMPPALETTE=/tmp/flamegraph-palette.map
./stackcollapse-jstack.pl $1 > $TMPSTACKS
# 1st run - hot: default
@npenkov
npenkov / Open iterm tab here
Created February 4, 2016 12:26 — forked from eric-hu/Open iterm tab here
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder. To use: (1) Open Automator (2) Create a new service (3) Change "Service receives selected" drop downs to "Files or folders" in "Finder" (4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer:
@npenkov
npenkov / README.md
Created January 26, 2016 12:03 — forked from nicerobot/README.md
Mac OS X uninstall script for packaged install of node.js

To run this, you can try:

curl -ks https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh

@npenkov
npenkov / enable_safari_debug_menu.sh
Created September 11, 2014 11:21
Enable Safari Debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu 1
@npenkov
npenkov / 0_reuse_code.js
Created August 31, 2014 08:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console