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 objc_util import * | |
us = ObjCClass('UIScreen') | |
if us.mainScreen().scale() == 2.0: | |
print('Retina') | |
elif us.mainScreen().scale() == 3.0: | |
print('iPhone 6 Plus') | |
else: | |
print('Non retina') |
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
# cat ~/.pip/pip.conf | |
[global] | |
default-timeout = 60 | |
respect-virtualenv = true | |
#download-cache = /home/xen/.pip/cache | |
log-file = /home/xen/.pip/pip.log | |
use-wheel = yes | |
find-links = /home/xen/.pip/wheels | |
[wheel] |
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 i18njson-translate.py --help | |
Usage: i18njson-translate.py [OPTIONS] INPUTFILE OUTPUT | |
Process and translate .po or JSON files and generate translated .po file | |
in result. Can work with exist .po files and if in initial file msgid | |
dissapear then mark translaed string as obsolete. Try to play nice with | |
version control systems and follow initial file order format, you will get | |
predicteable diffs. | |
Options: |
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
[user] | |
name = XX | |
email = X@X.X | |
[color] | |
ui = true | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] |
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
# example | |
from flask import json | |
from .utils import docache | |
@api.route('/jsonmethod', defaults={'count': 10}) | |
@docache(hours=48, content_type='application/json') | |
def get_count(count): | |
# can be useable with JSON APIs |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from fontTools import ttLib | |
def writeFont(font, filename): | |
font.save(filename) | |
print "Wrote font to", filename |
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
# -*- coding: utf-8 -*- | |
# <nbformat>3.0</nbformat> | |
# <codecell> | |
import pytils | |
import datetime | |
import time | |
from selenium import webdriver |
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 test_metadata_family(self): | |
""" Font and METADATA.json have the same name """ | |
self.assertEqual(self.font.familyname, self.metadata.get('name', None)) | |
def test_em_is_1000(self): | |
""" Font em should be equal 1000 """ | |
self.assertEqual(self.font.em, 1000, | |
msg="Font em value is %s, required 1000" % self.font.em) |
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
tell application "iPhoto" | |
set curPhotos to selection | |
set theCount to 0 | |
repeat with thisPhoto in curPhotos | |
set theCount to theCount + 1 | |
get theCount | |
if theCount = 1 then | |
set lastPhoto to thisPhoto | |
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
[MASTER] | |
# Specify a configuration file. | |
#rcfile= | |
# Python code to execute, usually for sys.path manipulation such as | |
# pygtk.require(). | |
#init-hook= | |
# Profiled execution. |