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
/* Smoke system for pipe --------------------------------------------------------*/ | |
var NUM_PARTICLES = 100 | |
var EMITTER_X = 155 | |
var EMITTER_Y = 120 | |
var MIN_SIZE = 0.1 | |
var MAX_SIZE = 0.3 | |
var MIN_VELOCITY_Y = 0.2 | |
var MAX_VELOCITY_Y = 0.8 | |
var VELOCITY_X = 0 |
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
function textToHTML(text) { | |
return ((text || "") + "") // make sure it's a string; | |
.replace(/&/g, "&") | |
.replace(/</g, "<") | |
.replace(/>/g, ">") | |
.replace(/\t/g, " ") | |
.replace(/ /g, "​ ​") | |
.replace(/\r\n|\r|\n/g, "<br />"); | |
} |
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
###################################### | |
# Format Options | |
###################################### | |
# The date_format variable followed by a space, specifies | |
# the log format date containing any combination of regular | |
# characters and special format specifiers. They all begin with a | |
# percentage (%) sign. See `man strftime` | |
# | |
#Any Apache log date format |
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
from sys import stdout | |
from time import sleep | |
for i in range(1,20): | |
stdout.write("\r%d" % i) | |
stdout.flush() | |
sleep(1) | |
stdout.write("\n") # move the cursor to the next line |
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 sys | |
import subprocess | |
from time import sleep | |
cmd = ['top', '-l 0'] | |
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
for line in iter(p.stdout.readline, 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
""" Inspired by http://flask.pocoo.org/snippets/40/ """ | |
app = Flask(__name__) | |
@app.url_defaults | |
def hashed_url_for_static_file(endpoint, values): | |
if 'static' == endpoint or endpoint.endswith('.static'): | |
filename = values.get('filename') | |
if filename: | |
if '.' in endpoint: # has higher priority |
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
<?php | |
$sum = 2; | |
for ($i = 3; $i < 10000; $i+=2) { | |
$flag = TRUE; | |
for ($j = 2; $j <= sqrt($i); $j++) { | |
if ($i % $j == 0) { | |
$flag = FALSE; |
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
<?php | |
$sum = 2; | |
for ($i = 3; $i <= 10000; $i++) { | |
$k = 1; | |
for ($j = 2; $j < $i; $j++) { | |
if ($i % $j == 0) { | |
$k = 0; |
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
<?php | |
function odd($var) { | |
return($var & 1); | |
} | |
function even($var) { | |
return(!($var & 1)); | |
} |
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
/* Design done by Arthur Steiner (c), the rest by Anne van Kesteren (c) */ | |
@font-face { font-family:anneisawesome; src:url(/fonts/big-noodle-titling) } | |
html { margin:20px 30px; font:1em/1.5 Verdana, sans-serif; background:#46016a } | |
body { position:relative; margin:0 0 0 160px; padding:0 1em; border-left:10px solid #7e7a4c; min-width:200px; background:#c2c152 } | |
h1 { position:absolute; top:5px; left:-155px; margin:0; height:107px; width:282px; z-index:1; content:url(/img/logo) "Weblog 4.2"; font:2.6em/0.4 anneisawesome, Impact, sans-serif; text-indent:-4px } | |
p#tagline { margin:0; padding-top:5em; font-size:1.2em } | |
form#search { position:absolute; top:10px; right:20px; z-index:1 } | |
form#search input[type=search] { border:thin solid #000; vertical-align:top } | |
form#search input[type=search]:focus { outline:thick solid #000 } | |
form#search input[type=submit] { margin:2px 0 0; padding:0; border:none; float:right; display:block; content:url(/img/find); width:30px; cursor:pointer } |
OlderNewer