h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)
h2. General
| ⌘T | go to file | | ⌘⌃P | go to project | | ⌘R | go to methods | | ⌃G | go to line | | ⌘KB | toggle side bar | | ⌘⇧P | command prompt |
from django.test import TestCase | |
from .models import Thing | |
# Create your tests here. | |
class TestModels(TestCase): | |
def test_saving_a_model(self): | |
thing = Thing.objects.create() | |
thing.save() |
h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)
h2. General
| ⌘T | go to file | | ⌘⌃P | go to project | | ⌘R | go to methods | | ⌃G | go to line | | ⌘KB | toggle side bar | | ⌘⇧P | command prompt |
I hereby claim:
To claim this, I am signing this object:
# wtf stands for write to file ;) | |
def wtf(text): | |
f = open("/tmp/out.log",'a') | |
f.write(text+'\n') | |
f.flush() |
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE application/atom+xml \ | |
application/javascript \ | |
application/json \ | |
application/rss+xml \ | |
application/vnd.ms-fontobject \ | |
application/x-font-ttf \ | |
application/xhtml+xml \ | |
application/xml \ | |
font/opentype \ |
#!/usr/bin/env python | |
#!/usr/bin/env ruby | |
#!/usr/bin/env perl | |
#!/usr/bin/env bash | |
#!/usr/bin/env php | |
#!/usr/bin/env node | |
#!/usr/bin/env osascript |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
[3bot-settings] | |
BOT_ENDPOINT=* | |
# A complete list of available directives id available on: | |
# https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior | |
from datetime import datetime | |
now = datetime.now() | |
print now.strftime('%d. %b %Y') # 17. Sep 2014 | |
print now.strftime('%d.%m.%y') # 17.09.14 | |
#"%D %d %M %Y" -> 'Wed 09 Jan 2008' |