Skip to content

Instantly share code, notes, and snippets.

View Luminus's full-sized avatar

Luminus Olumide Alabi Luminus

View GitHub Profile
@Luminus
Luminus / pg_start.sh
Created February 1, 2015 01:13
I installed postgresql on my mac using MacPorts and created these scripts so I can easily start and stop the server without going nuts. I put these scripts in my personal /bin at ~/bin/ and run chmod +x on them
#!/bin/bash
sudo su postgres -c '/opt/local/lib/postgresql94/bin/pg_ctl -D /opt/local/var/db/postgresql94/defaultdb -l /opt/local/var/db/postgresql94/defaultdb/postgresql.log start'
@Luminus
Luminus / gist:bcb2fb4c032dd33d3de8
Created February 1, 2015 01:26
I had to run this to enable the pg gem in my app work. This way I can use postgre on my development computer and also push to heroku. The --with-pg-config bit tells the gem how to find my postgre install confiurations.
gem install pg -- --with-pg-config=/opt/local/lib/postgresql94/bin/pg_config
@Luminus
Luminus / gist:9b569213e796696542d2
Last active March 14, 2018 07:32
Rename the default git that comes with OSX to remove it from $PATH after installing an up-to-date version
sudo mv /usr/bin/git /usr/bin/git-apple
@Luminus
Luminus / gist:897133afb4f6ddb1a6fe
Created February 24, 2015 00:33
Anvil + Pow + Powder with no internet connection
# Anvil installs Pow if you don't already have it installed.
# Add your sites to Anvil to get your .dev domains
# Install Powder
gem install powder
# Add your .dev domains to your /etc/host file
# This way, whether you have an internet connection or not, you're good.
powder host
Verifying that +luminus is my openname (Bitcoin username). https://onename.com/luminus
@Luminus
Luminus / erb2slim.sh
Last active August 29, 2015 14:17
Convert all .erb files in your rails app to .slim
find ./app/views -name '*.erb' | xargs -I file sh -c \
'html2haml --erb file | haml2slim > $(echo file | sed 's/erb/slim/') && \
rm file'
@Luminus
Luminus / post.thor
Created May 4, 2015 03:44
Automate Post Creation in Jekyll by putting this file in the root of the jekyll project and installing the required gems
require "stringex"
require "thor"
class Post < Thor
desc "new TITLE", "Create a new post"
method_option :editor, :default => "mou"
method_option :date, aliases: "-d",
default: Time.now.strftime('%Y-%m-%d'),
@Luminus
Luminus / github-create
Last active August 29, 2015 14:21
Create a GitHub repo from Terminal. Paste this in ~/.bash_profile or if like me you use zsh, paste it in ~/.zshrc
github-create() {
repo_name=$1
dir_name=`basename $(pwd)`
if [ "$repo_name" = "" ]; then
echo "Repo name (hit enter to use '$dir_name')?"
read repo_name
fi

Keybase proof

I hereby claim:

  • I am luminus on github.
  • I am luminus (https://keybase.io/luminus) on keybase.
  • I have a public key whose fingerprint is F104 0029 018E A112 D080 E5CF D5EB BA2B 88EF 0CA2

To claim this, I am signing this object:

@Luminus
Luminus / functions.php
Last active July 25, 2016 18:30
WooCommerce Product Vendors: Change vendor URL slug
add_filter( 'wcpv_vendor_slug', 'change_vendor_slug' );
function change_vendor_slug( $slug ) {
return 'new_slug';
}