Skip to content

Instantly share code, notes, and snippets.

@shturm
shturm / SublimeJSConsoleLog.sublime-snippet
Created March 3, 2014 13:01
Sublime text 2/3 snippet for console.log() in Javascript. To install place the file with this content in Linux: ~/.config/sublime-text-3/Packages/User/consolelog.sublime-snippet or Windows: SUBLIMEINSTALLROOT\Packages\User\consolelog.sublime-snippet. The actual file name doesn't matter, only the extension does.
<snippet>
<content><![CDATA[
console.log(${1:'${2:}'});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>con</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
@shturm
shturm / a2addsite.py
Last active January 1, 2016 05:29
Simple python script for adding sites in Ubuntu 12.04+. Given a <site-name> it: Creates /var/www/<site-name> folder, Sets 0777 permissions to the document root, Creates and enables a virtual host configuration, Reloads apache2 web server. Has option --mysql for creating a mysql database for the site
#!/usr/bin/python
import sys
import os
import getpass
from subprocess import call, PIPE, Popen
if (len(sys.argv) == 1 or sys.argv[1] == 'help'):
print "Usage is:\n\tsudo a2addsite <site-name> [--mysql]"
print "Parameters:"