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
<link rel="import" href="../polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
<link rel="import" href="../polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../paper-calculator/paper-calculator.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
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 os | |
import png | |
IMG_DIR = './static/img/' | |
for _, _, files in os.walk(IMG_DIR): | |
for file in files: | |
if file.endswith('.png'): | |
with open(IMG_DIR + file, 'r+') as f: | |
height, width = png.Reader(f).read()[:2] | |
f.seek(0) # reset pointer |
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
### Controller ideas | |
# Subcontroller takes the lead | |
class Controller(object): | |
def go(self): | |
a = self.aye() | |
yield a | |
b = self.bee(a) | |
yield b |
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/python2.7 | |
import requests | |
def getItems(from_date, to_date): | |
api_root = 'http://api.thriftdb.com/api.hnsearch.com/items/_search' | |
url = api_root + '?filter[fields][create_ts]=[{}+TO+{}]'.format(from_date, to_date) | |
payload = { | |
'limit': 100, | |
'sortby': 'create_ts desc', |
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
#!env python2.7 | |
import feedparser | |
from datetime import datetime, timedelta | |
d = feedparser.parse("http://www.meetup.com/events/atom/MEETUP_RSS_URL/all")['entries'] | |
def getDate(content): | |
from bs4 import BeautifulSoup |
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 | |
# | |
# usage: check_lostfound.py <pathtolost+found> [make_it_so] | |
# | |
# Purpose: to find files in lost+found and trying to restore | |
# original files by comparing ls-md5sum-files.txt (generated by | |
# make-lsLR.sh | |
# Option make_it_so cause the data actually being written/moved | |
# whereas the script runs in dry mode per default. | |
# |
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
#!/bin/bash | |
# | |
# Usage: ./make-lsLR.sh | |
# | |
# Purpose: | |
# to make a file that is parseable for recovering | |
# a filled /lost+found directory by parsing | |
# filesize, md5sum, permisions and path+filename | |
# | |
# Author: Ingo Juergensman - http://blog.windfluechter.net |
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
#!/bin/python2.7 | |
# -`*- coding: utf-8 -*- | |
from gevent import monkey | |
monkey.patch_all() | |
import flask | |
app = flask.Flask(__name__) | |
app.debug = True | |
app.secret_key = 'asdf' |
NewerOlder