Skip to content

Instantly share code, notes, and snippets.

Avatar
🦊
Gettin' foxy with it

Dan Mikita danmikita

🦊
Gettin' foxy with it
View GitHub Profile
@danmikita
danmikita / init.vim
Created Nov 16, 2018
File preview with FZF, RG, Bat, and Devicons
View init.vim
nnoremap <silent> <leader>e :call Fzf_dev()<CR>
" ripgrep
if executable('rg')
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
set grepprg=rg\ --vimgrep
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
endif
" Files + devicons
@danmikita
danmikita / gist:4ac6e09a81d182260f1a
Created Sep 8, 2014
Change DB Password with Puppet
View gist:4ac6e09a81d182260f1a
exec {"changeDbPassword":
command => "echo 'SQL TO CHANGE PASSWORD' | sqlplus / as sysdba"
}
@danmikita
danmikita / gist:528f568a775eab946c3c
Created Sep 4, 2014
Turn off iptables with puppet
View gist:528f568a775eab946c3c
service {'iptables':
ensure => stopped
}
View gist:216c444eb4005d1718a6
# -*- mode: ruby -*-
# vi: set ft=ruby :
##############################################
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
#
# Be sure to install the Proxy Plugin:
# vagrant plugin install vagrant-proxyconf
#############################################
VAGRANTFILE_API_VERSION = "2"
@danmikita
danmikita / gist:712d0781e0dedbb4193f
Created Sep 4, 2014
Port Forwarding for Oracle XE on vagrant box
View gist:712d0781e0dedbb4193f
config.vm.network :forwarded_port, guest: 1521, host: 1521 # Oracle XE
@danmikita
danmikita / CustomActionBar.java
Created Feb 18, 2014
Custom Action Bar Layout
View CustomActionBar.java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_sample, container, false /* attachToRoot */);
ActionBar actionBar = ((ActionBarActivity) getActivity()).getSupportActionBar();
setHasOptionsMenu(true);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);
View actionBarView = inflater.inflate(R.layout.custom_actionbar_layout, null);
actionBar.setCustomView(actionBarView, new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
@danmikita
danmikita / git_push_deployments.md
Last active Dec 21, 2015
In an enterprise it can be very important to track the release version of various applications. In an attempt to simplify how we track old releases, as well as how we roll back to previous versions, I wanted to find a way to use git push to deploy various git tags. This would allow for a more standard approach to deploys within our organization.
View git_push_deployments.md

Git Push Deployments

Some Background Information

In git, a tag (like many other things) is what's called a treeish. It's a way of referring to a point in the history of the project. Treeishes can be a tag, a commit, a date specifier, an ordinal specifier or many other things. A branch is just like a tag but is movable. When you are on a branch and make a commit, the branch is moved to the new commit you made indicating it's current position.

Your HEAD is a pointer to a branch which is considered "current". Usually when you clone a repository, HEAD will point to master which in turn will point to a commit. When you then do something like git checkout experimental, you switch the HEAD to point to the experimental branch, which might point to a different commit.

When you do a git checkout v2.0 (v2.0 in this case is a tag), you are switching to a commit that is not pointed to by a branch. The HEAD is now "detached" and not po