Skip to content

Instantly share code, notes, and snippets.


Dan Previte dprevite

View GitHub Profile
View reddit.css
.expando-button, .thing .expando-button.image, .thing div.expando-button, .thing div.expando-button.collapsed {
margin: 2px 5px 2px 0;
height: 23px!important;
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zd…gxPSIxNi41IiB5MT0iMTguNzUiIHgyPSIyMSIgeTI9IjE4Ljc1IiAvPgoJPC9nPgo8L3N2Zz4=);
dprevite /
Last active Jun 2, 2017
new homestead mailcatcher

First, Install rbenv

  1. git clone ~/.rbenv
  2. Add the following to your .bashrc or .zshrc
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
  1. Run source ~/.zshrc or source ~/.bashrc
  2. git clone ~/.rbenv/plugins/ruby-build
dprevite / install-comodo-ssl-cert-for-nginx.rst
Created Oct 24, 2015 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

find . -type f -iname '*.php' -not -path "./vendor/*" -exec bash -c 'echo $0 && expand -t 2 -i "$0" >"$0.expand.tmp" && mv "$0.expand.tmp" "$0"' {} \;
dprevite / post-commit
Created Apr 16, 2015
git post-commit for lolcommits
View post-commit
export PATH="/usr/bin/ruby:$PATH"
lolcommits --capture --delay=3 --animate=8
slackup "#lolcommits" "$(ls ~/.lolcommits/${PWD##*/}/$(git rev-parse HEAD | cut -c1-11).*)" &
dprevite / update_post_commits.php
Last active Aug 29, 2015
Search computer for all git repos and add lolcommits hook to all the post-commit files
View update_post_commits.php
* Search forward starting from end minus needle length characters
* @param string $haystack The string to search within
* @param string $needle The string to search for
* @return boolean
dprevite /
Created Nov 23, 2014
tabfix tabs to spaces
sudo pip install -U tabfix
tabfix --input-tab-size=2 -r --match="*.html" -v target_dir/

Keybase proof

I hereby claim:

  • I am dprevite on github.
  • I am dprevite ( on keybase.
  • I have a public key whose fingerprint is A98D 75AB D814 79AD 11E9 BE13 B7B8 013A 8498 380A

To claim this, I am signing this object:

dprevite /
Last active Nov 28, 2016 — forked from brandonb927/
My fork of
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Set the colours you can use
View parse_brackets.php
function parse() {
$special = [
'[' => ']',
'{' => '}',
'(' => ')'
$string = str_split('(())');