Skip to content

Instantly share code, notes, and snippets.

Avatar

Da CodeKid dacodekid

View GitHub Profile
@dacodekid
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
dacodekid / Vagrant
Created Sep 25, 2017
Vagrant Root Login On Provision
View Vagrant
Vagrant.configure(2) do |config|
config.vm.box = "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"
end
# --- COPY PUBLIC KEY INTO MACHINE ---
@dacodekid
dacodekid / dokku+django.md
Created Mar 13, 2017
Starting up with Dokku, Django, Let's Encrypt and PostgreSQL on Python 3.5.2
View dokku+django.md

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

  1. Verify needed files & settings

    #PROJ_ROOT/Procfile
    web: gunicorn <myproj>.wsgi
    
    #PROJ_ROOT/requirements.txt
    dj-database-url==0.4.1
    
View rethinkdb_setup_osx.md

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
dacodekid / mongo-autostart-osx.md
Last active Sep 23, 2015 — forked from subfuzion/mongo-autostart-osx.md
mongo auto start on OS X
View mongo-autostart-osx.md

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)

View osx-for-hackers.sh
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
View gunicorn_start.bash
#!/bin/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.