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
#via http://stackoverflow.com/questions/2186525/use-a-glob-to-find-files-recursively-in-python | |
import fnmatch | |
import os | |
matches = [] | |
for root, dirnames, filenames in os.walk('src'): | |
for filename in fnmatch.filter(filenames, '*.c'): | |
matches.append(os.path.join(root, 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
@app.route('/edit/<int:page_id>', methods=['GET']) | |
def edit(page_id): | |
context = "Edit" | |
page = Page.query.get(page_id) | |
title = page.title | |
text = page.text | |
return render_template('edit.html', title=title, text=text, context=context) | |
@app.route('/edit/<int:page_id>', methods=['POST']) |
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
require 'rubygems' | |
require 'sentiment_analysis' | |
def get_sentiment(text) | |
sa = SentimentAnalysis::Client.new(:api_key => 'YOUR_API_KEY') | |
sentiment = sa.review(:text => text, :format => :json) | |
# The limit on the text is 360 characters. | |
return sentiment | |
end |
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 twitter_link(handle) | |
avatars_path = 'public/img/avatars/' | |
avatar = handle + '.jpg' | |
avatar_path = avatars_path + avatar | |
img_tag = "<img src='#{avatar_path.sub(/^public/, '')}' />" | |
# Check and see if there's already an avatar. | |
unless File.exists?(avatar_path) | |
# We don't have it. Let's try to get it from Twitter. | |
begin |
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
aluminium | |
kerfuffle | |
shenanigans |
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
gee-off | |
geff | |
goff | |
george | |
jiff | |
joff | |
greg |
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
Show hidden characters
{ | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"trim_trailing_white_space_on_save": true, | |
"tab_size": 4, | |
"translate_tabs_to_spaces": true, | |
"detect_indentation": false, | |
"use_tab_stops": true |
NewerOlder