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 flask_rage import app as application |
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
<VirtualHost *> | |
ServerName hostsite.com | |
WSGIDaemonProcess flask_rage user=my_username group=group1 threads=5 | |
WSGIScriptAlias / /var/www/ragetext/flask_rage.wsgi | |
<Directory /var/www/ragetext> | |
WSGIProcessGroup flask_rage | |
WSGIApplicationGroup %{GLOBAL} | |
Order deny,allow |
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 foo(): | |
for x in range(5): | |
yield x | |
yield x*2 | |
(letfn [(first [x] | |
(lazy-seq | |
(when (<= x 5) | |
(cons x (second x))))) | |
(second [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
(def denoms [1000 500 100 25 5 1]) | |
(def names {2000 :twenties | |
1000 :tens | |
500 :fives | |
100 :dollars | |
25 :quarters | |
5 :nickels | |
1 :pennies}) |
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 denoms [1000 500 100 25 5 1]) | |
(def names {2000 :twenties | |
1000 :tens | |
500 :fives | |
100 :dollars | |
25 :quarters | |
5 :nickels | |
1 :pennies}) |
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 denoms [1000 500 100 25 5 1]) | |
(def names {2000 :twenties | |
1000 :tens | |
500 :fives | |
100 :dollars | |
25 :quarters | |
5 :nickels | |
1 :pennies}) |
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
;;Small minor mode to control spotify from emacs | |
(defun spotify-play () "Play Spotify" (interactive) | |
(shell-command "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play")) | |
(defun spotify-pause () "Pause Spotify" (interactive) | |
(shell-command "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause")) | |
(defun spotify-playpause () "Play/Pause Spotify" (interactive) | |
(shell-command "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause")) |
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
<snip> | |
LoadModule setenvif_module /usr/lib/apache2/modules/mod_setenvif.so | |
# Drop the Range header when more than 5 ranges. | |
# CVE-2011-3192 | |
SetEnvIf Range (,.*?){5,} bad-range=1 | |
RequestHeader unset Range env=bad-range | |
# bad-range logging | |
CustomLog logs/range-CVE-2011-3192.log common env=bad-range |
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
if site_config.browse_facet_show and facets: |
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
range = http_request_header['Range'] # would be of type list in this example | |
def request_header(bad_range): | |
if bad_range: | |
range = None | |
return range | |
def setenvif(): | |
bad_range = None | |
if len(range) > 5: |
OlderNewer