Skip to content

Instantly share code, notes, and snippets.

View HondoOhnaka's full-sized avatar

Hondo HondoOhnaka

  • Ohnaka Transport Solutions
  • Black Spire Outpost, Batuu
View GitHub Profile
@HondoOhnaka
HondoOhnaka / django-launch.json
Created March 28, 2020 04:31 — forked from slaveofcode/django-launch.json
Sample Django Configuration launch.json VSCode (Visual Studio Code)
{
"version": "0.2.0",
"configurations": [
{
"name": "Django",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"pythonPath": "${workspaceRoot}/venv/bin/python3.4",
"program": "${workspaceRoot}/manage.py",
@HondoOhnaka
HondoOhnaka / git-remove-forever.sh
Created May 15, 2018 18:25 — forked from wdalmut/git-remove-forever.sh
Remove files or folders from git history forever!
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0
|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█|█
|█|S|*|*|*|*|*|*|*|*|█|*|*|*|*|*|*|*|*|*|*|*|_|_|_|_|█|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|█|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|_|_|_|_|_|_|_|_|_|_|█|*|*|*|*|*|*|*|*|*|*|*|*|*|_|_|_|_|_|_|█
|█|*|█|█|█|█|█|█|█|*|█|*|█|█|█|█|█|*|█|█|█|*|█|█|█|█|█|█|█|*|█|█|█|█|█|*|█|█|█|█|█|*|█|█|█|*|█|█|█|*|█|█|█|*|█|█|█|█|█|█|█|*|█|█|█|*|█|█|█|*|█|█|█|_|█|█|█|█|█|█|█|*|█|█|█|*|█|█|█|█|█|█|█|*|█|_|█|█|█|_|█
|█|*|█|*|*|*|*|*|█|*|*|*|█|*|*|*|*|*|_|_|█|*|*|*|*|*|_|_|█|*|█|*|*|*|*|*|█|_|_|_|█|*|█|*|*|*|█|_|█|*|*|*|█|*|*|*|*|*|*|*|█|*|█|*|*|*|█|*|█|*|*|*|*|*|█|*|*|*|*|*|*|*|█|*|*|*|█|*|*|*|*|*|█|*|█|_|█|_|█|_|█
|█|*|█|█|█|█|█|*|█|█|█|█|█|*|█|█|█|█|█|█|█|*|█|█|█|*|█|█|█|*|█|█|█|*|█|█|█|_|█|█|█|*|█|*|█|█|█|_|█|█|█|*|█|█|█|*|█|█|█|*|█|█|█|*|█|█|█|*|█|*|█|█|█|*|█|█|█|*|█|█|█|*|█|*|█|█|█|*|█|█|█|█|█|*|█|_|█|_|█|_|█
|█|*|_|_|
@HondoOhnaka
HondoOhnaka / gist:b45650b993313ae1b7b9
Created March 24, 2015 13:11
Dump a local base and import to Heroku - Django
# https://devcenter.heroku.com/articles/heroku-postgres-import-export
# dump local
pg_dump -Fc --no-acl --no-owner -h localhost <db_name> > ~/Desktop/db.dump
# Restore:
heroku pg:backups restore 'https://www.dropbox.com/<db_url>?dl=1' DATABASE_URL -a appname
@HondoOhnaka
HondoOhnaka / gist:b72572dd0f1f6ad26f94
Last active August 29, 2015 14:17 — forked from jimmyeisenhauer/gist:2795771
Drop database and rebuild - Django
heroku pg:reset SHARED_DATABASE --confirm appname
heroku run appname/manage.py migrate
heroku run appname/manage.py createsuperuser
@HondoOhnaka
HondoOhnaka / PinThis Wordpress Plugin
Created November 13, 2014 04:36
A simple plugin example to create a Pinterest pin button on any post with a featured image set.
<?php
/*
Plugin Name: PinThis
Plugin URI: http://scienceofweb.com
Description: This plugin will add a "Pin" button link to each
post on your WordPress site.
Author: Jim Munro
Version: 0.1
Author URI: http://scienceofweb.com
*/
# Orignal version taken from http://www.djangosnippets.org/snippets/186/
# Original author: udfalkso
# Modified by: Shwagroo Team and Gun.io
import sys
import os
import re
import hotshot, hotshot.stats
import tempfile
import StringIO
# https://djangosnippets.org/snippets/154/
# required for the django-google-contacts
# install as a site-package for use
# updated to use json module
from django.core.serializers import json, serialize
from django.db.models.query import QuerySet
from django.http import HttpResponse
import json
@HondoOhnaka
HondoOhnaka / compat.py
Created May 16, 2014 18:13
Handles loading new user models avoid the Apps have not been registered error.
# https://github.com/un33k/django-tastypie/blob/master/tastypie/compat.py
# handles loading new user models avoid the Apps have not been registered error.
from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import django
from django.utils.functional import lazy
__all__ = ['User', 'AUTH_USER_MODEL']
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too