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 check_dict(indic, template): | |
return all(item in indic.items() for item in template.items()) |
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 pip.req import parse_requirements | |
# parse_requirements() returns generator of pip.req.InstallRequirement objects | |
install_reqs = parse_requirements("requirements.txt") | |
# reqs is a list of requirement | |
# e.g. ['django==1.5.1', 'mezzanine==1.4.6'] | |
reqs = [str(ir.req) for ir in install_reqs] |
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
db.<collection_name>.find().forEach(function(d){ db.getSiblingDB('<new_database>')['<collection_name>'].insert(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
class MessageProperty(property): | |
def __init__(self, path, *args, **kwargs): | |
property.__init__(self, *args, **kwargs) | |
self.path = path | |
def _target(self, dic): | |
path = self.path | |
dest = dic | |
lastkey = path[-1] | |
for p in path[:-1]: |
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 __future__ import print_function | |
import requests | |
try: | |
import Tkinter as tk | |
import tkMessageBox as tkm | |
except Exception: | |
import tkinter as tk | |
from tkinter import messagebox as tkm |
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 automation to submit to a journal (e.g. Elsevier). | |
# It detects the main latex file and eps files used. | |
# Author: @balkian | |
# TODO: Only import the tex files used in the main file, and their images. | |
AUX_DIR=.aux | |
LATEX=$(basename $(shell grep -l '\\begin{document' *.tex)) | |
LETTER=letter | |
COVER=cover | |
HIGHLIGHTS=highlights |
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
{% set f=open_file("xls") %} | |
{% set sheet=f.sheet_by_index(0) %} | |
{% if not baseuri %} | |
{% set baseuri="default" %} | |
{% endif %} | |
{ | |
"@context": [ | |
"http://demos.gsi.dit.upm.es/eurosentiment/static/context.jsonld", | |
{ | |
"@base": "{{ baseuri }}", |
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 ubuntu:14.04 | |
RUN apt-get update -y | |
RUN apt-get install -y curl | |
RUN apt-get install -y diffstat | |
RUN apt-get install -y git | |
RUN apt-get install -y python | |
RUN apt-get install -y python3 | |
RUN apt-get install -y tmux | |
RUN apt-get install -y vim |
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
mashable big_picture theonion time breakingnews bbcbreaking espn harvardbiz gizmodo techcrunch wired smashingmag wsj whitehouse rollingstone cnn whitehouse tweetmeme peoplemag foxnews huffingtonpost newsweek slate reuters incmagazine eonline usatoday good gawker msnbc_breaking life latimes telegraphnews abc7 bbc_world washingtonpost msnbc guardiannews |
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
alter table t alter column j type jsonb using j::text::jsonb; |