⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
# create initial migration from existing models | |
./manage.py schemamigration app_name --initial | |
# apply the migration | |
./manage.py migrate app_name | |
# make a change, create a new migration | |
./manage.py schemamigration app_name --auto |
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
AuthType Basic | |
AuthName "Restricted Files" | |
AuthBasicProvider file | |
AuthUserFile /path/to/password/file | |
Require user valid-user |
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
adduser --system --no-create-home --group --shell /bin/false --disabled-password --disabled-login redis |
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
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user | |
# Then relaunch finder or reboot machine |
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/bash | |
# setup | |
suffix=`date +%Y%m%d` | |
dest=/home/wide/dbs | |
cmd='/usr/bin/mysqldump' | |
user='backuper' | |
password='jfhiue839' | |
#databases="mysql test" |
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
# jump straight to open finder window. Remember fish uses parentheses instead of backticks. | |
function cdf | |
set -l target (osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)') | |
if test $target != "" | |
cd "$target" | |
pwd | |
else | |
echo 'No Finder window found' >&2 | |
end |
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
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
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
# This is the syntax to add a component to $PATH in the fish shell | |
set -gx PATH /usr/local/mysql/bin/ $PATH | |
# Note the space between the new component and the existing $PATH variable. |
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 is_paginated %} | |
<div class="pagination"> | |
<ul> | |
{% if page_obj.has_previous %} | |
<li><a href="?page={{ page_obj.previous_page_number }}"> | |
{% else %} | |
<li class="disabled"><a href="#"> | |
{% endif %} | |
Prev</a></li> | |
{% for p in page_obj.paginator.page_range %} |
OlderNewer