Skip to content

Instantly share code, notes, and snippets.

View danmikita's full-sized avatar
🦊
Gettin' foxy with it

Dan Mikita danmikita

🦊
Gettin' foxy with it
View GitHub Profile
@danmikita
danmikita / init.vim
Created November 16, 2018 19:16
File preview with FZF, RG, Bat, and Devicons
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 September 8, 2014 12:14
Change DB Password with Puppet
exec {"changeDbPassword":
command => "echo 'SQL TO CHANGE PASSWORD' | sqlplus / as sysdba"
}
@danmikita
danmikita / gist:528f568a775eab946c3c
Created September 4, 2014 23:52
Turn off iptables with puppet
service {'iptables':
ensure => stopped
}
# -*- 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 September 4, 2014 19:41
Port Forwarding for Oracle XE on vagrant box
config.vm.network :forwarded_port, guest: 1521, host: 1521 # Oracle XE
@danmikita
danmikita / CustomActionBar.java
Created February 18, 2014 19:58
Custom Action Bar Layout
@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 December 21, 2015 09:08
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.

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