This file contains hidden or 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
| """ Imports json in a standard format to Django objects """ | |
| import json, re, logging, sqlite3 | |
| from redisclg import RedisBayes | |
| logging.basicConfig(filename='/root/py-proj/clg-env/clg_proj/logfile.log',level=logging.DEBUG) | |
| class BaseImporter(object): | |
| # @@TODO add file_path param to init | |
| def __init__(self, src, list_id, db_src="clg_proj.sqlite3"): | |
| self.list_id = list_id |
This file contains hidden or 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
| """ Imports json in a standard format to Django objects """ | |
| import json, re, logging, sqlite3 | |
| from redisclg import RedisBayes | |
| logging.basicConfig(filename='/root/py-proj/clg-env/clg_proj/logfile.log',level=logging.DEBUG) | |
| class BaseImporter(object): | |
| # @@TODO add file_path param to init | |
| def __init__(self, src, list_id, db_src="clg_proj.sqlite3"): | |
| self.list_id = list_id |
This file contains hidden or 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
| """ Imports json in a standard format to Django objects """ | |
| import json, re, logging, sqlite3 | |
| from redisclg import RedisBayes | |
| logging.basicConfig(filename='/root/py-proj/clg-env/clg_proj/logfile.log',level=logging.DEBUG) | |
| class BaseImporter(object): | |
| # @@TODO add file_path param to init | |
| def __init__(self, src, list_id, db_src="clg_proj.sqlite3"): | |
| self.list_id = list_id |
This file contains hidden or 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
| #!/bin/bash | |
| function show_usage { | |
| echo "Usage: $0 theme_name" | |
| exit 1 | |
| } | |
| if [ $# -ne 1 ]; then | |
| show_usage | |
| fi |
This file contains hidden or 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
| # Ignore configuration files that may contain sensitive information. | |
| sites/*/settings*.php | |
| # Ignore various other cruft | |
| .DS_Store | |
| .buildpath | |
| .project | |
| .settings | |
| /backup | |
| /tmp |
This file contains hidden or 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
| #! /bin/bash | |
| # Installs django into virtual environment with dependencies | |
| # usage: pdjang project-name | |
| # thanks to github/jart whose django-bone forms the basis of this | |
| # Define a bunch of silly variables | |
| proj=$1 | |
| projRoot="/root/py-proj" | |
| envName="$1-env" | |
| envDir="$projRoot/$envName" | |
| projName="$1_proj" |
This file contains hidden or 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
| # Lazily evaluate class properties in Python. | |
| # Only loads properties if needed. | |
| # Use for expensive operations. | |
| # by Steven Loria https://gist.github.com/sloria | |
| # The slow way -- DON'T DO THIS | |
| class Person: | |
| def __init__(self, name, occupation): | |
| self.name = name | |
| self.occupation = occupation |
This file contains hidden or 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
| # A regex-based price string validator | |
| # Author: Paul Walker | |
| class PriceValidator(object): | |
| """ Takes a price string and validates price, unit type, and unit value. """ | |
| def __init__(self, item_raw): | |
| try: | |
| self.price_string = str(item_raw['price']) | |
| self.description = str(item_raw['description']) | |
| except ValueError, e: |
This file contains hidden or 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
| ;;; | |
| ;;; dragon.el: code to smooth out the Dragon NaturallySpeaking/Gnuemacs | |
| ;;; interaction | |
| ;;; | |
| ;;; | |
| ;;; This code does not make Gnuemacs fully select-and-say, but you | |
| ;;; will be able to select and correct your dictation to Emacs since | |
| ;;; you last issued a voice command or clicked the mouse. It also | |
| ;;; allows you to correctly dictate text containing non-ASCII | |
| ;;; characters like accented letters to Emacs. |
This file contains hidden or 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
| var carousel = { | |
| buttonContainer: ".carousel-controls", | |
| buttonElement: "li", | |
| imageContainerSelector: "#home-carousel-images ul", | |
| imageElement: "li", | |
| bannerContainer: "#home-banner .primary-container", | |
| bannerElement: ".banner-content", | |
| mobileBannerContainer: "#home-banner-mobile", | |
| mobileBannerElement: ".banner-entry", |