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
# editor backups and auto-saves | |
*~ | |
*.bak | |
*.swp | |
\#*# | |
# files generated by TeX system or TeX editors | |
*.aux | |
*.glo | |
*.idx |
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
clearInterval($rootScope.last_tick) | |
$rootScope.last_tick = setIntervall(self.updateFunction, 2000) |
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
from datetime import date | |
from sqlalchemy import cast, DATE | |
Match.query.filter(cast(Match.date_time_field, DATE)==date.today()).all() |
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
% Scope: | |
set(0,'ShowHiddenHandles','On') | |
set(gcf,'Units','centimeters','PaperUnits','centimeters') | |
pos = get(gcf,'Position'); | |
set(gcf,'PaperPosition',[0 0 pos(3) pos(4)],'Papersize',[ pos(3),pos(4) ]); | |
set(gcf,'InvertHardcopy','off','Renderer','painters') | |
saveas(gcf,'scope.pdf') | |
% Model: |
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
def pretty_date(dt, default='gerade'): | |
""" | |
Returns string representing "time since" e.g. | |
3 days ago, 5 hours ago etc. | |
Ref: https://bitbucket.org/danjac/newsmeme/src/a281babb9ca3/newsmeme/ | |
""" | |
now = datetime.utcnow() | |
diff = now - dt | |
periods = ( | |
(diff.days / 365, 'Jahr', 'Jahren'), |
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
""" some documentation:http://www.effbot.org/imagingbook/ """ | |
from PIL import ImageOps | |
from PIL import Image | |
def scale_picture(img_path, size=(150,150), save_path='/tmp', subdir=False): | |
""" | |
img_path: absolute path to a picture | |
size: (width, height) tuple | |
save_path: where the new files be saved |
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
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
# from boto.s3.connection import Location | |
class FilehandlerAmazon(): | |
def __init__(self, aws_id, aws_key): | |
self.aws_id = aws_id | |
self.aws_key = aws_key | |
self.conn = S3Connection(self.aws_id, self.aws_key) |
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
<!-- put Forms here --> | |
<input type="submit" name="button" value="Save"> | |
<input type="submit" name="button" value="Cancel"> |
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
""" | |
https://developer.android.com/google/gcm/index.html | |
https://github.com/geeknam/python-gcm | |
""" | |
from gcm import GCM | |
API_KEY = 'secret' | |
DEVICE_REG_ID = 'some_registrated_device_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
import os | |
def all_files(dirname): | |
for root, dirs, filenames in os.walk(dirname): | |
for f in filenames: | |
print f | |
# log = open(os.path.join(root, f),'r') | |
def all_files_in_dir(dirname): | |
onlyfiles = [ f for f in os.listdir(dirname) if os.path.isfile(os.path.join(dirname,f)) ] |
OlderNewer