This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls import patterns, include, url | |
from chordcharts.views import ChordListView #for class based views | |
from chordcharts import views #for function based views | |
urlpatterns = patterns('', | |
url(r'^$', ChordListView.as_view(), name='chord_list'), #for class based views | |
url(r'^$', 'chordcharts.views.chord_list', name='chord_list'), #for function based views | |
url(r'^chordcharts/', include('chordcharts.urls')), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log 127.0.0.1 local0 notice | |
maxconn 20000 | |
user haproxy | |
group haproxy | |
defaults | |
log global | |
mode tcp | |
option dontlognull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for i in '123'|make_list %} | |
{% if object.property == i|add:"0" %} | |
<li>(Selected) Property {{ i }}</li> | |
{% else %} | |
<li>Property {{ i }}<li> | |
{% endif %} | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
image_folder = '/Users/brian/Desktop/Student_Images' | |
image_linkfile = image_folder+'/idlink.txt' | |
f = open(image_linkfile,'wb') | |
for filename in os.listdir(image_folder): | |
filepath = os.path.join(image_folder,filename) | |
if os.path.isfile(filepath): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from base64 import b64encode | |
from reportlab.lib import units | |
from reportlab.graphics import renderPM | |
from reportlab.graphics.barcode import createBarcodeDrawing | |
from reportlab.graphics.shapes import Drawing | |
class barcode: | |
def get_barcode(self, value, width, barWidth = 0.05 * units.inch, fontSize = 30, humanReadable = True): | |
barcode = createBarcodeDrawing('Code128', value = value, barWidth = barWidth, fontSize = fontSize, humanReadable = humanReadable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import tornado.ioloop | |
import tornado.web | |
MIN_TEMP = 0 | |
ERROR_TEMP = -999.99 | |
TEMP_SENSORS = { | |
"28-00043a4518ff" : {"label":"A","location":"Server-1-Front","temperature":None}, | |
"28-00043b61b4ff" : {"label":"B","location":"Server-1-Back","temperature":None}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import reversion | |
from django.db import models | |
from django.contrib.auth.models import User | |
class RevisionManager(models.Manager): | |
def get_queryset(self): | |
return super(RevisionManager, self).get_queryset().latest() | |
class Ticket_Status(models.Model): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import rrdtool | |
import json | |
MIN_TEMP = 0 | |
ERROR_TEMP = -999.99 | |
TEMP_SENSORS = { | |
"E" : {"sensor":"28-00043a4518ff","location":"Server Room Rack B/C (Back)","temperature":{"celsius":None,"fahrenheit":None}}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import datetime | |
from datetime import datetime | |
import csv | |
import traceback | |
from django.core.management.base import BaseCommand, CommandError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from PIL import Image | |
size = 145, 145 | |
dir_path = '/Users/brian/Desktop/systems_silly' | |
for filename in os.listdir(dir_path): | |
if filename.endswith('.bmp'): | |
# Destroy Previously Converted Bmp | |
try: | |
os.remove(os.path.join(dir_path,filename.replace('.jpg','.bmp'))) | |
except: |
OlderNewer