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
SetBitNr(PORTA, 4); // +3VA on | |
// Turn on ADC | |
SetBitNr(ADCSRA, ADEN); | |
ClrBitNr(PRR0, PRADC); | |
WaitForSampleRateTimer(); | |
start_ecg_sample_timer(); | |
WDR(); |
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
XXXXYYYYZZZZ (X, Y, Z) | |
------------ | |
00f4803e40fe (-3072, 16000, -448) | |
00f4c03e80fe (-3072, 16064, -384) | |
40f4403e40fe (-3008, 15936, -448) | |
40f4003f80fe (-3008, 16128, -384) | |
c0f3803e00fe (-3136, 16000, -512) | |
00f4003e40fe (-3072, 15872, -448) | |
c0f3403e40fe (-3136, 15936, -448) | |
c0f3403effff (-3136, 15936, -1) |
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 import forms | |
from models import ArticleImage | |
class ArticleImageForm(forms.ModelForm): | |
class Meta: | |
model = ArticleImage | |
fields = ('image', ) |
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
def wiki_access(f): | |
def wrap(request, *args, **kwargs): | |
wiki = _get_wiki_from_request(request, **kwargs) | |
if request.user.is_authenticated(): | |
try: | |
user_company = request.user.personnel.company | |
except ObjectDoesNotExist: | |
pass | |
else: |
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 random | |
import string | |
def random_code(): | |
available_chars = string.uppercase + string.digits | |
return ''.join(random.choice(available_chars) for i in xrange(8)) | |
for i in xrange(10): | |
print "code %d: %s" % (i, random_code()) |
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
" Python indent file | |
" Language: Python | |
" Maintainer: Gustaf Hansen <[email protected]> | |
" Original Author: David Bustos <[email protected]> | |
" Last Change: 2012-04-10 | |
" Only load this indent file when no other was loaded. | |
if exists("b:did_indent") | |
finish | |
endif |
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
#!/bin/bash | |
# Git post checkout hook. | |
# Reminds you of South migration changes when switching branches. | |
# Can be useful when you are when you are testing out a branch from | |
# someone else that requires migrations. | |
# Put the file in .git/hooks/post-checkout | |
PREVIOUS_HEAD=$1 | |
NEW_HEAD=$2 |
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 json | |
import re | |
import requests | |
# Set USERNAME and PASSWORD to your Github credentials and REPO_URL to your github repo. | |
import settings | |
auth = (settings.USERNAME, settings.PASSWORD) | |
api_url = 'https://api.github.com/repos/%s/%%s' % (settings.REPO_URL, ) |
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 haystack.sites import site | |
from planner.models import SharedMealPlan | |
# Make sure the search index is registered | |
import planner.search_indexes | |
index = site.get_index(SharedMealPlan) | |
index.reindex() |
NewerOlder