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
| #-*- coding:utf-8 -*- | |
| import json | |
| from collections import defaultdict | |
| x = json.load(open('gram_select_small.json')) | |
| words = x["1"] | |
| words = words.items() | |
| words.sort(key=lambda i: i[1], reverse=True) | |
| grams = defaultdict(dict) |
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 console.models import * | |
| cs = Creative.objects.all() | |
| keys = [ | |
| 'css:.img_footer_body ul .img_footer_page img:width', | |
| 'css:.img_footer_body ul .img_footer_page img:height', | |
| 'css:.thumb:width', | |
| 'css:.thumb:height' | |
| ] |
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
| notifications: | |
| slack: '' | |
| language: python | |
| python: | |
| - '2.7' | |
| before_install: | |
| - sudo apt-get update -qq | |
| - sudo apt-get install -qq libxml2-dev libxslt1-dev |
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
| <?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'><html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'><head><title>Pretty Diff - The difference tool</title><meta name='robots' content='index, follow'/> <meta name='DC.title' content='Pretty Diff - The difference tool'/> <link rel='canonical' href='http://prettydiff.com/' type='application/xhtml+xml'/><meta http-equiv='Content-Type' content='application/xhtml+xml;charset=UTF-8'/><meta http-equiv='Content-Style-Type' content='text/css'/><style type='text/css'>body{font-family:'Arial';font-size:10px;overflow-y:scroll}#announcement.big{color:#00c;font-weight:bold;height:auto;left:14em;margin:0;overflow:hidden;position:absolute;text-overflow:ellipsis;top:4.5em;white-space:nowrap;width:50%;z-index:5}#announcement.big strong.duplicate{display:block}#announcement.big span{display:block}#announcement.normal{color:#000;font-weight:normal;height:2.5em;margin:0 -5em -4.75em;position |
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
| (function(d) { | |
| if (typeof tagtoo_advertiser_id != "undefined") { | |
| var tagtooIframe = d.createElement("iframe"); | |
| tagtooIframe.src = "//ad.tagtoo.co/static/ad/html/track.html#ad=" + tagtoo_advertiser_id + "&p=" + encodeURIComponent(document.location.href); | |
| tagtooIframe.scrolling = "no"; | |
| tagtooIframe.width = 1; | |
| tagtooIframe.height = 1; | |
| tagtooIframe.marginheight = 0; | |
| tagtooIframe.marginwidth = 0; | |
| tagtooIframe.frameborder = 0; |
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 collections import defaultdict | |
| class vdict(defaultdict): | |
| def __missing__(self, key): | |
| return self.default_factory(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
| #!/usr/bin/env python | |
| import dio | |
| import fileinput | |
| import json | |
| from itertools import product | |
| import re | |
| re_name = re.compile(r'\.([\w]+)(.*)') | |
| re_index = re.compile(r'\.\[([\d]*):?([\d]*):?([\d]*)\](.*)') |
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
| <link rel="import" href="../google-map/google-map.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| <style> | |
| :host { | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; |
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 load_pipeline(cls_path): | |
| module_path, class_name = ".".join(cls_path.split('.')[:-1]), cls_path.split('.')[-1] | |
| mod = __import__(module_path, fromlist=[class_name]) | |
| return getattr(mod, class_name) | |
| class TriggerHandler(ApiHandler): | |
| def get(self): |
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 sys | |
| from collections import defaultdict | |
| def shorten(p): | |
| new_p = [p[0]] | |
| last = p[0] | |
| for c in p: | |
| if c == last: | |
| continue | |
| last = c |