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 | |
# | |
# This file echoes a bunch of color codes to the terminal to demonstrate | |
# what's available. Each line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a test use of that color | |
# on all nine background colors (default + 8 escapes). | |
# | |
# Source: | |
# http://bitmote.com/index.php?post/2012/11/19/Using-ANSI-Color-Codes-to-Colorize-Your-Bash-Prompt-on-Linux | |
# |
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 printf(format, *args, **kwargs): | |
"""printf in Python with Python 3-style format strings""" | |
print(format.format(*args, **kwargs), 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
import requests | |
for match in requests.get('http://worldcup.sfg.io/matches').json(): | |
if match['status'] == 'completed': | |
print('{home[code]} {home[goals]}, {away[code]} {away[goals]}' \ | |
.format(home=match['home_team'], away=match['away_team'])) |
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
/** | |
* A basic hello world in Java | |
*/ | |
public class HelloWorld { | |
public static void main(String[] args) { | |
System.out.println("Hello, world!"); | |
} | |
} |
NewerOlder