Skip to content

Instantly share code, notes, and snippets.


Da CodeKid dacodekid

View GitHub Profile
dacodekid / index.html
Last active Dec 14, 2019
Hugo with Webpack Integration
View index.html
<!-- refer generated css/js file -->
<link rel="stylesheet" href="{{$.Site.BaseURL}}/{{ if eq (getenv "APP_ENV") "dev" }}main.css{{ else }}{{ index .Site.Data.manifest "main.css" | relURL }}{{ end }}">
<script type="text/javascript" src="{{$.Site.BaseURL}}/{{ if eq (getenv "APP_ENV") "dev" }}main.js{{ else }}{{ index .Site.Data.manifest "main.js" | relURL }}{{ end }}"></script>
dacodekid / Vagrant
Created Sep 25, 2017
Vagrant Root Login On Provision
View Vagrant
Vagrant.configure(2) do |config| = "debian/jessie64"
# --- IF private_key FILE EXISTS, THEN LOGIN AS root
if File.exist?(Dir.getwd + "/.vagrant/machines/default/virtualbox/private_key")
config.ssh.username = "root"
config.ssh.private_key_path = "~/.ssh/id_rsa"
dacodekid /
Created Mar 13, 2017
Starting up with Dokku, Django, Let's Encrypt and PostgreSQL on Python 3.5.2

Steps to set up a Django+PostgreSQL app using Dokku on Python 3.5.2

  1. Verify needed files & settings

    web: gunicorn <myproj>.wsgi

RethinkDB Setup on OSX

This guide will get RethinkDB setup and running with a default configuration on OSX. There is also an option for setting RethinkDB to start at boot time on OSX, and a note on upgrading to a more recent RethinkDB version.

First Installation

Install Homebrew if you don't already have it:

dacodekid /
Last active Sep 23, 2015 — forked from subfuzion/
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

# OSX for Hackers (Mavericks/Yosemite)
# Source:
# Some things taken from here
# Ask for the administrator password upfront
View gunicorn_start.bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
You can’t perform that action at this time.