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
| { | |
| "color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme", | |
| "draw_white_space": "all", | |
| "enable_tab_scrolling": false, | |
| "font_face": "Monoid", | |
| "font_size": 14, | |
| "highlight_line": true, | |
| "ignored_packages": | |
| [ | |
| "CSS", |
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
| var funcKeys = {"114": "F3", "115": "F4", "116": "F5", "117": "F6", "118": "F7"}; | |
| $(document).keydown(function(e) { | |
| if (e.keyCode == 114 || | |
| e.keyCode == 115 || | |
| e.keyCode == 116 || | |
| e.keyCode == 117 || | |
| e.keyCode == 118) | |
| { | |
| e.preventDefault(); | |
| event.returnValue = false; |
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 $$ | |
| CREATE TRIGGER name_of_trigger | |
| AFTER INSERT ON the_table_name | |
| FOR EACH ROW | |
| BEGIN | |
| INSERT INTO the_other_table_name | |
| (the_column, another_column) | |
| VALUES | |
| (1234, NOW()); | |
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 TEMPORARY TABLE table_name AS ( | |
| -- Your select | |
| ); |
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
| (?<=href=").*(?=") |
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
| SELECT r.* | |
| FROM random AS r | |
| JOIN (SELECT RAND() * (SELECT MAX(id) FROM random) AS id) AS r2 | |
| WHERE r.id >= r2.id | |
| LIMIT 1; |
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
| <?php | |
| $file = '/location/to/the/file.pdf'; | |
| if (file_exists($file)) { | |
| header('Content-Description: File Transfer'); | |
| header('Content-Type: application/octet-stream'); | |
| header('Content-Disposition: attachment; filename='.basename($file)); | |
| header('Content-Transfer-Encoding: binary'); | |
| header('Expires: 0'); |
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
| function parse_git_branch { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
| } | |
| txtblk='\e[0;30m' # Black - Regular | |
| txtred='\e[0;31m' # Red | |
| txtgrn='\e[0;32m' # Green | |
| txtylw='\e[0;33m' # Yellow | |
| txtblu='\e[0;34m' # Blue | |
| txtpur='\e[0;35m' # Purple |
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
| DROP TABLE IF EXISTS tmp_table; | |
| CREATE TEMPORARY TABLE tmp_table (id INT); | |
| INSERT tmp_table | |
| SELECT id | |
| FROM table_a t1 | |
| WHERE EXISTS ( | |
| SELECT * | |
| FROM table_a t2 | |
| WHERE t2.some_id = t1.some_id |
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
| <?php | |
| function check_column_last_values_unique($arr, $column, $last) | |
| { | |
| $data = array_splice($arr, -$last); | |
| $values = array_map(function($a) use ($column) { return $a[$column]; }, $data); | |
| $unique = array_unique($values); | |
| if (count($unique) == 1) { | |
| return "true"; |
OlderNewer