Skip to content

Instantly share code, notes, and snippets.

Avatar

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
dprevite / setup.md
Last active Jun 2, 2017
new homestead mailcatcher
View setup.md

First, Install rbenv

  1. git clone https://github.com/rbenv/rbenv.git ~/.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 https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
@dprevite
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 Namecheap.com 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

View tabs-to-spaces.sh
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
dprevite / post-commit
Created Apr 16, 2015
git post-commit for lolcommits
View post-commit
#!/bin/sh
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
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
<?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
dprevite / tabfix.sh
Created Nov 23, 2014
tabfix tabs to spaces
View tabfix.sh
# https://github.com/mar10/tabfix
sudo pip install -U tabfix
tabfix --input-tab-size=2 -r --match="*.html" -v target_dir/
View keybase.md

Keybase proof

I hereby claim:

  • I am dprevite on github.
  • I am dprevite (https://keybase.io/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
dprevite / osx-for-hackers.sh
Last active Nov 28, 2016 — forked from brandonb927/osx-for-hackers.sh
My fork of osx-for-hackers.sh
View osx-for-hackers.sh
#!/bin/sh
# 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
black='\033[0;30m'
View parse_brackets.php
<?php
function parse() {
$special = [
'[' => ']',
'{' => '}',
'(' => ')'
];
$string = str_split('(())');