Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Thomas Schmitt teschmitt

🏠
Working from home
View GitHub Profile
View infsys_serie-3.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@teschmitt
teschmitt / inventory_models.py
Created Jun 26, 2018
Test Inventory Database Models
View inventory_models.py
class Product(models.Model):
profile = models.ForeignKey('accounts.Profile', null=True,
blank=True, on_delete=models.CASCADE)
name = models.CharField(max_length=180)
class ProductOption(models.Model):
product = models.ForeignKey(Product, on_delete=models.CASCADE)
nr = models.IntegerField(default=0)
name = models.CharField(max_length=20, null=False, blank=False)
@teschmitt
teschmitt / output_data.csv
Last active Jul 9, 2018
Get tumblr posts by tag
View output_data.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 8 columns, instead of 7. in line 1.
content,date,time,tags,id,blog_name,post_url,type
"When Grandma would take care of us at our old house. She would always conversate with @patgomez91 on the side about a lot of things! When looking at them together, it reminds me of the old days. 😢
.
.
.
#life #love #goals #happy #lifestyle #positivity #peace #believe #entrepreneur #positivevibes #goodvibes #blessed #beautiful #quotes #motivational #successful #healthy #business #strength #hope #truth #spiritual #quoteoftheday #health #smile #joy #inspirational #family #dream (at Los Angeles, California)",2017-12-24,23:17:06,"['positivity', 'goals', 'strength', 'dream', 'happy', 'peace', 'lifestyle', 'beautiful', 'inspirational', 'blessed', 'quoteoftheday', 'motivational', 'business', 'successful', 'love', 'life', 'positivevibes', 'family', 'quotes', 'health', 'spiritual', 'truth', 'healthy', 'entrepreneur', 'hope', 'goodvibes', 'joy', 'believe', 'smile']",168906004762,pjaysodope-blog,http://pjaysodope-blog.tumblr.com/post/168906004762/when-grandma-would-t
@teschmitt
teschmitt / forms.py
Last active Dec 14, 2017
Django ModelForm Label Transation
View forms.py
from django import forms
from .models import Topic
from django.utils.translation import ugettext_lazy as _
class NewTopicForm(forms.ModelForm):
message = forms.CharField(
widget=forms.Textarea(
attrs={'rows': 5, 'placeholder': 'What is on your mind?'}
),
max_length=4000,
@teschmitt
teschmitt / mergesort.py
Last active Oct 7, 2017
A pythonic merge sort implementation
View mergesort.py
""" Straightforward approach, shaving sorted elements off of the beginning of the partitions """
def merge(l_left, l_right):
l_sorted = []
while l_left and l_right:
if l_left[0] <= l_right[0]:
l_sorted.append(l_left.pop(0))
else:
l_sorted.append(l_right.pop(0))
# Extend return variable by list with remaining entries
return l_sorted + l_left + l_right
You can’t perform that action at this time.