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
UPDATE T1P | |
INNER JOIN T2 | |
ON T1.match1 = T2.match1 | |
INNER JOIN T3 | |
ON T3.match2 = T2.match2 | |
SET T1.new_column = T3.source_of_new_column; |
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
Show hidden characters
{ | |
"cmd": ["mysql -u USERNAME -pPASSWORD DATABASE -t < $file >> /tmp/output.sql ; subl3 /tmp/output.sql"], | |
"selector": "source.sql", | |
"shell" : true | |
} |
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
[ | |
{ | |
"args": null, | |
"command": "select_all" | |
}, | |
{ | |
"args": { | |
"setting": "tab_size", | |
"value": 2 | |
}, |
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/bash | |
find $1/ -type f -exec md5sum {} + | awk '{print $1}' | sort | md5sum |
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
# Do this in your environment | |
python setup.py develop --install-dir /path/to/virtualen/lib/python3.4/site-packages | |
# or: python setup.py develop --multi-version --exclude-scripts --install-dir /path/to/virtualen/lib/python3.4/site-packages |
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
-- PostgreSql | |
SELECT | |
pg_database.datname AS "Database Name", | |
pg_database_size(pg_database.datname) / 1024.0 / 1024.0 AS "Database Size (MB)" | |
FROM pg_database; | |
-- MySql | |
SELECT | |
table_schema "Database Name", | |
sum( data_length + index_length ) / 1024 / 1024 "Database Size (MB)" |
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
//This function was used in my test rig to convert elasticsearch results to a KML structure which is | |
// later fed to an iFrame wrapping the GoogleEarth plugin | |
var data=[]; | |
var buckets=inData.aggregations.map.buckets; | |
function addCommas(nStr) | |
{ | |
nStr += ''; |
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
SELECT setval('TEABLE_NAME_id_seq', (SELECT MAX(id) FROM TEABLE_NAME)); |
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/bash | |
python -m smtpd -n -c DebuggingServer localhost:1025 |
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 django.test.client import RequestFactory | |
factory = RequestFactory() | |
request = factory.get('/') |
OlderNewer