This file contains hidden or 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
| delimiter # | |
| DROP PROCEDURE IF EXISTS dataForSomeID; | |
| CREATE PROCEDURE `dataForSomeID`(IN needThisID VARCHAR(20)) | |
| BEGIN | |
| SELECT * | |
| FROM sometable | |
| LEFT JOIN anothertable | |
| ON sometable.id = anothertable.id | |
| WHERE id=needThisID; |
This file contains hidden or 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
| DELETE FROM tablename | |
| WHERE idcolumn IN ( | |
| SELECT idcolumn | |
| FROM (SELECT DISTINCT idcolumn FROM tablename) x | |
| WHERE rand() <= 0.9 | |
| ) |
This file contains hidden or 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
| CREATE INDEX index_name ON table_name (column_name_or_list) |
This file contains hidden or 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
| exec(open("./filename").read()) |
This file contains hidden or 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 base64 | |
| base64.b64encode(b'Encode this string.') | |
| #b'RW5jb2RlIHRoaXMgc3RyaW5nLg==' | |
| decodedBytes = base64.b64decode(b'RW5jb2RlIHRoaXMgc3RyaW5nLg==') | |
| print(decodedBytes) | |
| #b'Encode this string.' | |
| decodedString = decodedBytes.decode('utf-8') |
This file contains hidden or 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
| { | |
| "data": [ | |
| { | |
| "Fieldname1": "1", | |
| "Fieldname2": "Lebron James", | |
| "Fieldname3": "Basketball", | |
| "Fieldname4": "23", | |
| "Fieldname5": "Cleveland", | |
| "Fieldname6": "SF", | |
| "Fieldname7": "2", |
This file contains hidden or 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 simplejson as json | |
| import MySQLdb | |
| #Better practice is to load and decrypt these values from a file | |
| dbname = 'databaseName' | |
| dbuser = 'username' | |
| dbpass = 'password' | |
| dbhost = 'host | |
| def procedureToJSON(procedureName, inputs=''): |
This file contains hidden or 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
| :%s/replaceThis/withThis/g |
This file contains hidden or 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
| git fetch origin | |
| git reset --hard origin/master | |
| #replace master with any other remote branch |
This file contains hidden or 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 /path/to/encoded/pwd/.en | |
| uenc=$(eval echo ${echo} | base64 --decode) |
OlderNewer