#Python ##String-Formatierung http://mkaz.com/solog/python/python-string-format.html
http://stackoverflow.com/questions/1388818/how-can-i-compare-two-lists-in-python-and-return-matches
| /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user |
| { | |
| "auto_complete_commit_on_tab": true, | |
| "bold_folder_labels": true, | |
| "caret_style": "phase", | |
| "color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme", | |
| "draw_white_space": "all", | |
| "font_face": "Monaco", | |
| "font_options": | |
| [ | |
| "subpixel_antialias" |
| c_found = sorted(list(set(list(map(int, c_found)))), key=int) | |
| # Lange Version | |
| """Konvertierung nach Integer""" | |
| ss_correct = list(map(int, ss_correct)) | |
| """Liste sortieren und doppelte Eintraege entfernen""" | |
| ss_correct = sorted(list(set(ss_correct)), key=int) |
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| import logging | |
| import optparse | |
| import sys | |
| """ | |
| By default, the logging module prints critical, error and warning messages. To change this so that all levels |
| function _getNaggingLabel() { | |
| var nagging_label_text = "[Gmail]/Archive"; | |
| var label = GmailApp.getUserLabelByName(nagging_label_text); | |
| if (label === null) | |
| { | |
| var label = GmailApp.createLabel(nagging_label_text); | |
| } | |
| return label; |
| from os import path, access, R_OK # W_OK for write permission. | |
| PATH='./file.txt' | |
| if path.isfile(PATH) and access(PATH, R_OK): | |
| print "File exists and is readable" | |
| else: | |
| print "Either file is missing or is not readable" |
| import os | |
| os.path.exists(filename) |
| # a simple filter that prepends line numbers | |
| # import sys EDIT: unused, pointed out in comments here and on HN | |
| for fname in ( 'file.txt', 'file2.txt, ): | |
| with open(fname, 'r+') as f: | |
| lineno = 0 | |
| # this reads in one line at a time from stdin | |
| for line in f: | |
| lineno += 1 | |
| print '{:>6} {}'.format(lineno, line[:-1]) |
| function cleanUp() { | |
| var delayDays = 2 | |
| var maxDate = new Date(); | |
| maxDate.setDate(maxDate.getDate()-delayDays); | |
| var label = GmailApp.getUserLabelByName("archive2days"); | |
| var threads = label.getThreads(); | |
| for (var i = 0; i < threads.length; i++) { | |
| if (threads[i].getLastMessageDate()<maxDate) | |
| { | |
| threads[i].markRead(); |