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 is_fib(candidate, known_fibs=[0,1]): | |
| last_fib = known_fibs[-1] | |
| if candidate == last_fib: | |
| return "IsFibo" | |
| elif candidate < last_fib: | |
| return "IsNotFibo" | |
| else: | |
| next_fib = last_fib + known_fibs[-2] | |
| new_fibs = known_fibs + [next_fib] | |
| return is_fib(candidate, known_fibs=new_fibs) |
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 C(): | |
| return "bat" | |
| def С(): | |
| return "man" | |
| if __name__ == "__main__": | |
| print(C(), С()) |
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
| billy gets 🎁 | |
| jill gets 💩 | |
| Jen gets 🎁 |
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
| 💩= Exception | |
| try: | |
| 4/0 | |
| except 💩: | |
| print("Dang it!") |
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 os import path | |
| import sys | |
| from wordcloud import WordCloud | |
| d = path.dirname(__file__) | |
| # Read the whole text. | |
| text = open(path.join(d, sys.argv[1])).read() | |
| wordcloud = WordCloud().generate(text) | |
| wordcloud.to_file(path.join(d, "repo.png")) |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| package main | |
| import "fmt" | |
| func main() { | |
| defer fmt.Println("world") | |
| fmt.Println("hello") | |
| } |
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
| var ITEMS_TO_CHECK = [ | |
| "S49022524", | |
| "S99022526", | |
| "S59022528", | |
| "S19022530", | |
| "S79022532", | |
| "S39022534", | |
| "S49022538", | |
| "S09022540" | |
| ]; |
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 flask import Flask, url_for, redirect | |
| from flask_dance.consumer import OAuth2ConsumerBlueprint | |
| app = Flask(__name__) | |
| app.secret_key = "<ISHOULDBESOMETHING>" | |
| batman_example = OAuth2ConsumerBlueprint( | |
| "batman-example", __name__, | |
| client_id="<CLIENT_ID>", | |
| client_secret="<SECRET>", | |
| base_url="https://graph.facebook.com", |
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
| bachmann@jabberwocky ~ python | |
| Python 2.7.9 (default, Dec 15 2014, 10:34:27) | |
| [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> dog = u"I am\u00A06011000990139424\u00A0creditCard" | |
| >>> type(dog) | |
| <type 'unicode'> | |
| >>> dog.encode('base64') | |
| Traceback (most recent call last): | |
| File "<stdin>", line 1, in <module> |