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 generate_tag_string(post_id, tags=[], new=False): | |
""" | |
... | |
""" | |
if new: | |
tags.append('new') | |
post = get_post(post_id) | |
post_tags = [t.decode("utf8", "ignore") for t in post.get('tags', [])] |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<!-- Latest compiled and minified JavaScript --> |
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
import sys | |
from PySide.QtCore import QObject, Slot, QTimer, Qt | |
from PySide.QtGui import QApplication, QWidget, QSplitter, QVBoxLayout, QShortcut, QKeySequence | |
from PySide.QtWebKit import QWebView, QWebSettings, QWebInspector | |
html = """ | |
<html> | |
<body> | |
<h1>Hello!</h1><br> |
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
import sys | |
from PySide.QtCore import QObject, Slot, QTimer | |
from PySide.QtGui import QApplication | |
from PySide.QtWebKit import QWebView, QWebPage | |
import logging | |
html = """ | |
<html> | |
<body> |
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/env python | |
import sys | |
import os | |
import dbm | |
import json | |
import uuid | |
print("BaKKit up") | |
try: | |
op = sys.argv[1] |
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
import inspect | |
REGISTRY = [] | |
CACHE = {} | |
def offline_runner(): | |
for fn, kwargs in REGISTRY: | |
#print "OFFLINE", fn, kwargs | |
CACHE[(fn, str(kwargs))] = fn(**kwargs) |
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
echo "this is a text in engish written only to demonstrate the validity of this method in selecting the right language" > corpus_en | |
echo "questo è un testo in italiano scritto solamente per dimostrare la validita di questo metodo nel selezionare il linguaggio voluto" > corpus_it | |
echo "questa è una prova di testo per testare la versione italiana" > test | |
(echo `cat corpus_en test | gzip | wc -c` en; echo `cat corpus_it test | gzip | wc -c` it) | sort -n | head -1 | |
echo "this is a test for the english version"> test | |
(echo `cat corpus_en test | gzip | wc -c` en; echo `cat corpus_it test | gzip | wc -c` it) | sort -n | head -1 |
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/env python | |
import itertools | |
import random | |
import string | |
import functools | |
# support functions | |
#Sample implementation of ireduce() |
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/env python | |
from optparse import OptionParser | |
import hashlib | |
import sys | |
parser = OptionParser() | |
parser.add_option("-b", "--blocksize", dest="blocksize", type=int, default=1024, | |
help="Specify blocksize", metavar="blocksize") |
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
<?php | |
/** | |
* Monad boxing integer side effects | |
* | |
* @package default | |
* @subpackage default | |
* @author Federico Marani | |
**/ | |
class IntegerBox | |
{ |
NewerOlder