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
# Three people are playing the following betting game. | |
# Every five minutes, a turn takes place in which a random player rests and the other two bet | |
# against one another with all of their money. | |
# The player with the smaller amount of money always wins, | |
# doubling his money by taking it from the loser. | |
# For example, if the initial amounts of money are 1, 4, and 6, | |
# then the result of the first turn can be either | |
# 2,3,6 (1 wins against 4); | |
# 1,8,2 (4 wins against 6); or | |
# 2,4,5 (1 wins against 6). |
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
# Snippet 1 | |
########### | |
# Copy the build folder(containing the html files) to a folder in flask's static | |
# directory and serve this way: | |
@app.route('/<dir>/<filename>', defaults={'static': True}) | |
def build_dir(dir='',filename='index.html'): | |
path = join(dir,filename) | |
return app.send_static_file(path) |
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
# Run in project root | |
# Recursively add executable bit to all files without a dot filename | |
find -type f -not -name "*.*" -exec chmod +x \{\} \; | |
# Recursively add exec bit to all files with .so in filename | |
find -type f -name "*.so*" -exec chmod +x \{\} \; | |
# Recursively add exec bit to all files with .so in filename | |
find -type f -name "*.jar*" -exec chmod +x \{\} \; |
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 | |
''' | |
Convert Blogger xml-exported file to markdown | |
Primarily from https://gist.github.com/larsks/4022537 with some modifications | |
''' | |
import os | |
import sys | |
import argparse | |
import iso8601 | |
import re |
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 dependencies | |
from functools import wraps | |
from google.appengine.api import users | |
from flask import redirect, request | |
USERS = ["any@gmail.com", "any@googleapps.com"] | |
#Set's the login to Google Users Service | |
def login_required(func): |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF | |
| FUCKIN PUSSIES | |
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS | |
13:16 <luite> | hello | |
13:16 <ChongLi> | somebody has a mental illness! | |
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel | |
| compelled to write Node.js! | |
13:16 <genisage> | hi | |
13:16 <luite> | you might be pleased to learn that you can compile | |
| haskell to javascript now |
When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.
Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008
…………………………
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 | |
import os | |
import sys | |
import argparse | |
import iso8601 | |
import re | |
import subprocess | |
import logging | |
import json |
NewerOlder