Skip to content

Instantly share code, notes, and snippets.

View halfnibble's full-sized avatar
🎃
Coding

Josh Wedekind halfnibble

🎃
Coding
View GitHub Profile
@halfnibble
halfnibble / template_example.html
Created January 28, 2016 20:29
HTML template example for Django CMS
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
.wrapper {
width: 900px;
margin: 0 auto;
}
.left-bar {
@halfnibble
halfnibble / test_fails.sh
Created August 6, 2015 08:19
The output of my djagno-cleanerversion tests.
Creating test database for alias 'default'...
Got an error creating the test database: (1007, "Can't create database 'test_pna_demo'; database exists")
Type 'yes' if you would like to try deleting the test database 'test_pna_demo', or 'no' to cancel: yes
Destroying old test database 'default'...
s..........F......F..........F...F.........FFF.Fss..sF.F...FFF.FFF...FsFFF.FF....ss..FF....FF....F.FFFFFF..F..ss
======================================================================
FAIL: test_on_delete (versions_tests.tests.test_models.DeletionHandlerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/joshua/.envs/pna/local/lib/python2.7/site-packages/versions_tests/tests/test_models.py", line 244, in test_on_delete
@halfnibble
halfnibble / python_example_1.py
Last active August 29, 2015 14:23
Python Example
# Imports
import os
from decimal import Decimal
# Variables
my_name = 'Joshua D. Wedekind'
my_rate = Decimal('120.00')
current_dir = os.getcwd()
# Classes
@halfnibble
halfnibble / install.sh
Last active August 29, 2015 14:22
Install script for my hosted zip archive of compiled playbook-dev-tools
#!/bin/sh
export NATIVE_TOOLS="/accounts/1000/shared/documents/clitools"
export NATIVE_TOOLS_URL="http://halfnibble.com/bbdev/"
# Write the QNX_CONFIGURATION file
CONFFILE="etc/qnxconf/qconfig/qnx_blackberry_native_development_kit_2.1.0.xml"
# Reusable temperature conversion function
def convert_temperature(to_scale, temperature):
if to_scale == "f" or to_scale == "F":
# Convert to Fahrenheit
return temperature * 9.0 / 5 + 32
elif to_scale == "c" or to_scale == "C":
# Convert to Celsius
return (temperature - 32) * 5.0 / 9.0
else:
@halfnibble
halfnibble / main.c
Created November 8, 2013 07:54
Test out Gist
#include <stdio.h>
int main(void)
{
printf("Hello World\n");
return 0;
}