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
{ :score AVERAGE-RATING | |
:stddev STANDARD-DEVIATION | |
:total TOTAL-RATINGS } |
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
(defn db-personality-user | |
[uid] | |
(let [faved (brains.db/user-site-faved-count uid) | |
mehed (brains.db/user-mehed-count uid) | |
hated (brains.db/user-hated-count uid)] | |
(assoc (personality faved mehed hated) | |
:uid uid))) | |
(defn db-personality-users | |
[] |
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
(defn usable-personalities | |
[personalities] | |
(filter #(> (:total %) 5) personalities)) | |
(defn render-personality | |
[personality] | |
(str (:stddev personality) | |
"," | |
(:score personality) | |
"," |
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
<list> | |
<item> | |
<name>Use the correct goddamed shift keys.</name> | |
<identifier>private.fucking_shift_keys_how_do_they_work</identifier> | |
<autogen>--KeyToKey-- KeyCode::Q, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen> | |
<autogen>--KeyToKey-- KeyCode::W, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen> | |
<autogen>--KeyToKey-- KeyCode::E, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen> | |
<autogen>--KeyToKey-- KeyCode::R, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen> | |
<autogen>--KeyToKey-- KeyCode::T, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen> |
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
\sR - Open a REPL | |
\et - Eval current toplevel form | |
\ef - Eval current file | |
\lw - Look up documentation for current word | |
C-X C-O - Autocomplete current word smartly |
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
Firefox | |
| | |
V | |
OS X Laptop port 4565 on OS X Linux VM | |
Nginx on port 80 -------> is forwarded to 80 on ------> Nginx on port 80 | |
the VM | | |
V | |
Gunicorn server |
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, os | |
old_file = sys.argv[1].rsplit('.', 2)[0] | |
if os.path.exists(old_file): | |
os.system('osascript -e \'tell app "Finder" ' | |
+ 'to move the POSIX file "' | |
+ os.path.abspath(old_file) + '" to trash\'') |
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
Index: templatetags/fb_versions.py | |
=================================================================== | |
--- templatetags/fb_versions.py (revision 692) | |
+++ templatetags/fb_versions.py (working copy) | |
@@ -11,6 +11,7 @@ | |
# filebrowser imports | |
from filebrowser.settings import MEDIA_ROOT, MEDIA_URL, VERSIONS | |
+from filebrowser.fields import FileBrowseField | |
from filebrowser.functions import path_to_url, get_version_path, version_generator |
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
diff --git a/filebrowser/fields.py b/filebrowser/fields.py | |
--- a/filebrowser/fields.py | |
+++ b/filebrowser/fields.py | |
@@ -96,10 +96,12 @@ | |
return FileObject(url_to_path(value)) | |
def get_db_prep_value(self, value, connection, prepared=False): | |
if value is None: | |
return None | |
+ if not value: |