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
// these are breakpoints made with Neat grids. | |
$medium-screen: new-breakpoint(min-width 640px 12); | |
$bigger-screen: new-breakpoint(min-width 910px 12); | |
$hugest-screen: new-breakpoint(min-width 1200px 12); | |
// to use: put this div at the top of your page | |
// <div id="sizer"></div> | |
#sizer { | |
font-size: 0.5em; |
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 compressor.filters import CompilerFilter | |
class CoffeeCompilerFinder(staticfiles.finders.AppDirectoriesFinder): | |
""" | |
A quick hacked up staticfiles-finder that will automatically recompile .coffee files to .js and serve the .js file | |
It will respond to a request for /foo/bar/baz.js and if the coffee-file with the same name in that same dir is newer then | |
then js-file requested then the js-file will be recompiled. | |
I did this to not have to manually recompile my scripts or use the watcher and still be compatible with require.js | |
without have to change the code once i deploy with compiled js-files. it depends on django-compressor at the moment | |
but if you dont use that its just a small class to lift out from it. |
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
class SomeView(View): | |
def dispatch(self, request, *args, **kwargs): | |
# imports and start profiling | |
import cProfile, pstats, StringIO | |
pr = cProfile.Profile() | |
pr.enable() | |
# all logic runs here |
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/sh | |
# to use, save this file as .git/hooks/pre-commit in your git repo | |
# make sure to add execute permissions using: chmod +x .git/hooks/pre-commit | |
command -v pngcrush >/dev/null 2>&1 || { | |
echo "\033[1mPlease install pngcrush to reduce images size before commit\033[0m" | |
echo "Install pngcrush with the following:" | |
echo "\t \033[1mbrew install pngcrush\033[0m" | |
echo "OR" | |
echo "\t Site: \033[1m\033[4mhttp://pmt.sourceforge.net/pngcrush/\033[0m" | |
echo "\t Download: \033[1m\033[4mhttp://sourceforge.net/projects/pmt/files/\033[0m" |
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
return gulp.src('app/**/scss/++/*.scss') | |
.pipe(sass()) | |
.pipe(gulp.dest(function(files) { | |
return path.join(file.base, '../css'); | |
})); |
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 functools import wraps | |
from django.conf import settings | |
from django.http import HttpResponseRedirect | |
def require_ssl(view): | |
""" | |
Decorator that requires an SSL connection. If the current connection is not SSL, we redirect to the SSL version of | |
the page. |
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
#I usually drop something like this into my virtualenv's postactivate for some | |
#quick and handy shortcuts to common Django commands. | |
#This way dropping in to do some work on any arbitrary project is as easy as: | |
# 1. workon <project name> | |
# 2. djr | |
cd /path/to/site/root | |
#Django command shortcuts | |
alias dj='python manage.py' |
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
var org_str = "j8ck72di"; | |
var session_str = "4734a9fc27f7fee1aa58f66046af6c49"; | |
var base_str = "https://ct-m-fbx.fbsbx.com/fp"; | |
var page_id = "1"; | |
var ip_addr_str = "820139e7306525d7"; | |
var tarpitting_param = ""; | |
var carrier_id_enabled = "false"; | |
var flash_tags = "true"; |
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
class ViewManager(models.Manager): | |
def bulk_create(self, *args, **kwargs): | |
raise NotImplementedError | |
def create(self, *args, **kwargs): | |
raise NotImplementedError | |
def get_or_create(self, *args, **kwargs): | |
raise NotImplementedError |
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
<toolSet name="Code Checking"> | |
<tool name="Flake8" showInMainMenu="true" showInEditor="true" showInProject="true" showInSearchPopup="true" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true"> | |
<exec> | |
<option name="COMMAND" value="/usr/local/bin/flake8" /> | |
<option name="PARAMETERS" value="--max-complexity 10 $FilePath$" /> | |
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" /> | |
</exec> | |
<filter> | |
<option name="NAME" value="Filter 1" /> | |
<option name="DESCRIPTION" /> |
OlderNewer