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 itertools | |
item_list = [ | |
{'counter1': 1, 'label': '20150408154801', 'counter2': 0, 'counter3': 0}, | |
{'counter1': 1, 'label': '20150408154801', 'counter2': 0, 'counter3': 0}, | |
{'counter1': 1, 'label': '20150408154801', 'counter2': 0, 'counter3': 0}, | |
{'counter1': 1, 'label': '20150408154819', 'counter2': 0, 'counter3': 0}, | |
{'counter1': 1, 'label': '20150408154819', 'counter2': 0, 'counter3': 0}, | |
{'counter1': 1, 'label': '20150408154819', 'counter2': 0, 'counter3': 0}, | |
{'counter1': 1, 'label': '20150408154819', 'counter2': 0, 'counter3': 0}, |
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
try: | |
from django.apps import apps | |
get_model = apps.get_model | |
except ImportError: | |
from django.db.models.loading import get_model |
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
source ~/.zshrc | |
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting | |
ORIGINAL_PATH=$PATH | |
function dev_env_setup() { | |
# see http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Commands.html | |
emulate -L zsh |
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 rm /var/lib/mongodb/mongod.lock | |
sudo mongod --repair --dbpath=/var/lib/mongodb | |
sudo chown -R mongodb:mongodb /var/lib/mongodb | |
sudo service mongod restart | |
sudo service mongod status |
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
[committemplate] | |
changeset = {desc}\n\n | |
HG: {extramsg} | |
HG: user: {author}\n{ifeq(p2rev, "-1", "", | |
"HG: branch merge\n") | |
}HG: branch '{branch}'\n{if(currentbookmark, | |
"HG: bookmark '{currentbookmark}'\n") }{subrepos % | |
"HG: subrepo {subrepo}\n" } | |
{splitlines(diff()) % 'HG: {line}\n'} |
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 Form = { | |
[...] | |
validate: function() { | |
var fields = this.form.querySelectorAll('input'); | |
var self = this; | |
fields.forEach(function(element) { | |
if (self.formFields.indexOf(element.name) !== -1) { | |
var allowed = self.formFields[element.name].allow; | |
self.invalid[element.name] = matchValues(element, allowed); | |
} |
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/zsh | |
YES='y' | |
OPTIND=1 | |
MODULE_NAME='' | |
filename='' | |
dirname='' | |
show_help() { | |
echo "Use this command with caution ;) (or not)" |
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
syntax: glob | |
.codeclimate.yml | |
.editorconfig | |
*.orig | |
.vscode/* | |
*.todo | |
*.tasks | |
.jsbeautify* | |
jsprofiles/* | |
*.orig.* |
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 | |
# this works for Bash and Zsh shell | |
a=("it is true for all that that that that that that that refers to is not the same that that that that refers to") | |
# Use this with Fish shell | |
# set a "it is true for all that that that that that that that refers to is not the same that that that that refers to" | |
# or if you need to count words in a sample file, | |
# cat <file> | tr " " "\n" | sort -n | uniq -c |
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
/*------------------------------------------ | |
Responsive Grid Media Queries - 1280, 1024, 768, 480 | |
1280-1024 - desktop (default grid) | |
1024-768 - tablet landscape | |
768-480 - tablet | |
480-less - phone landscape & smaller | |
--------------------------------------------*/ | |
@media all and (min-width: 1024px) and (max-width: 1280px) { } | |
@media all and (min-width: 768px) and (max-width: 1024px) { } |
OlderNewer