function gzf -a file | |
function help | |
echo "usage: gzf <file>" | |
end | |
# echo $file | |
if ! string match '^\.\/' | |
set file "./$file" | |
end |
javascript:(function() { | |
function copyToClipboard(text) { | |
if (window.clipboardData && window.clipboardData.setData) { | |
/*IE specific code path to prevent textarea being shown while dialog is visible.*/ | |
return clipboardData.setData("Text", text); | |
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { | |
var textarea = document.createElement("textarea"); | |
textarea.textContent = text; |
# From https://github.com/yarnpkg/yarn/issues/1776#issuecomment-269539948 | |
# The approach that has worked for me so far is this: | |
git rebase origin/master | |
# When the first conflict arises, I checkout the yarn.lock then re-perform the installation | |
git checkout origin/master -- yarn.lock | |
yarn install |
""" | |
Results: | |
multiple_update: 33 ms | |
copy_and_update: 27 ms | |
dict_constructor: 29 ms | |
kwargs_hack: 33 ms | |
dict_comprehension: 33 ms | |
concatenate_items: 81 ms | |
union_items: 81 ms |
class DisableMigrations(object): | |
def __contains__(self, item): | |
return True | |
def __getitem__(self, item): | |
return "notmigrations" | |
MIGRATION_MODULES = DisableMigrations() |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
-
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the
secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection. -
Use production SSL certificates locally. This is annoying
from boto.utils import parse_ts | |
from django.core.files.storage import get_storage_class | |
from storages.backends.s3boto import S3BotoStorage | |
""" | |
make sure you have this setting | |
AWS_PRELOAD_METADATA = True | |
and that you have python-dateutils==1.5 installed | |
""" |
function isRetina(){ | |
return (('devicePixelRatio' in window && devicePixelRatio > 1) || | |
('matchMedia' in window && matchMedia("(min-resolution:144dpi)").matches)) | |
} |
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |