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
# undo last commit, keep changes | |
git reset --mixed HEAD~1 | |
# git log by directory | |
git log --oneline -n 10 -- dir_name/ | |
# ammend git commit message | |
git rebase -i parent-commit-hash | |
# replace pick with reword, then update the commit message. |
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
### Collapse Current Code Block | |
ctrl + + | |
### Reduce Current Code Block | |
ctrl + - | |
### Display the hierarchy of the current class | |
ctrl + h | |
### Got to class |
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
/* fix twitter boostrap for <ul class='nav-tabs'> white color icons bug */ | |
.nav > .active > a > [class^="icon-"], | |
.nav > .active > a > [class*=" icon-"] { | |
background-image: url("../img/glyphicons-halflings.png"); | |
} | |
/* END fix twitter boostrap for <ul class='nav-tabs'> white color icons bug */ |
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
# Display hidden files | |
>>> defaults write com.apple.Finder AppleShowAllFiles YES | |
# Restart finder | |
# Hide files | |
>>> defaults write com.apple.Finder AppleShowAllFiles NO | |
# Restart finder |
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 MyMetaClass(type): | |
def __new__(cls, future_class_name, future_class_parents, future_class_attr): | |
class_object = type(future_class_name, future_class_parents, future_class_attr) | |
class_object.foo = "bar" | |
return class_object | |
class MyAwesomeClass(object): | |
constant = 1 | |
__metaclass__ = MyMetaClass |
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
# sublime text 2 | |
cmd + option | |
# intelli j IDEA | |
shift + option |
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
# Guide | |
# Configure the essential configurations below and do the following: | |
# | |
# Repository Creation: | |
# cap deploy:repository:create | |
# git add . | |
# git commit -am "initial commit" | |
# git push origin master | |
# | |
# Initial Deployment: |
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
### LOG | |
tail -f log/production.log |
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 apps.rp.management.commands_helpers.insert import InsertHelperMixin | |
from apps.rp.models.FixedCost import FixedCost | |
class FixedCostHelper(InsertHelperMixin): | |
entity = FixedCost | |
objects_to_insert = [ | |
{ | |
'name' : 'teu 200', | |
'typecost' : 0, | |
'typevalue' : 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
class InvoiceCreateView(LoginRequiredMixin, CreateView): | |
model = Invoice | |
form_class = InvoiceForm | |
template_name = 'panel/invoices/create.html' | |
def get_initial(self): | |
client = self.get_client() | |
return {'billing_address': client.address, "invoice_number" : self.get_invoice_number() } | |
def get_client(self): |