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(apps, _): | |
Category = apps.get_model("main", "MoveCategory") | |
for i, name in enumerate(DEFAULT_CATEGORY_NAMES): | |
category = Category.objects.create(**{ | |
"name": name, | |
"description": "", | |
"one_handed": i % 2 == 0, | |
"number_of_packets": None, | |
}) | |
category.save() |
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
for i in "$@" ; do # for all args | |
if [[ $i == "boot" ]]; then # if arg equals this string | |
# do this | |
bash ~/projects/dollars/as/django/bootserver.sh | |
break | |
fi | |
done |
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
function clear_selection() { | |
/* | |
I use this to ensure the `next` and `prev` buttons don't | |
stay highlighted when clicking quickly. | |
*/ | |
if(document.selection && document.selection.empty){ | |
document.selection.empty(); | |
} else if (window.getSelection){ | |
var sel = window.getSelection(); | |
sel.removeAllRanges(); |
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
function determine_left_index(len){ | |
/* | |
If the number of locations doesn't divide equally | |
into three perform a function on that number that | |
will determine the index we should point to. | |
Example: | |
len = 20 // twenty photo objects | |
len % 3 == 0 // returns false, 20 does not divide equally into 3 | |
len/3 // returns 6.666... | |
(len/3)|0 // returns 6 which says we have six screens of three photos |
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
git show $(git log --oneline | grep SSO$ | awk 'FNR == 2 {print $1}') |
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
# where .py is the extention to search on | |
( find ./ -name '*.py' -print0 | xargs -0 cat ) | wc -l | |
# also, | |
wc -l **/*rb | |
# also, this counts every line of every file | |
grep '' -R . | wc -l | |
# wc will print the number of lines in a file or multiple files |
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
function init_visited_attractions(){ | |
/* | |
Visited Attractions. | |
Displays the destinations that the current User has visited on the map. | |
If the user has completed the map and chose to `restart` the visited | |
attractions feature will stay populated with all the attractions on the | |
map while the user continues to log activity. | |
Displays each `screen` as three seperate photos/locations/attractions. | |
See Redmine ticket #4449 for more information. | |
*/ |
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
<div ng-repeat="cm in classic_moves | filter:classic_moves_query | orderBy:'date_created'">{{ cm.name }}</div> |
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
# In a senario where you need changes done | |
# on a branch. But the remote repository | |
# has a lot of clones that should NOT see | |
# the changes happening on the branch in | |
# question. Then `transfer.hiderefs` | |
# is the answer to your problem. | |
# Create the protected branch on your local repo. | |
# This will be the branch that no other repo |
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
sudo chmod -R 666 path/to/dir |