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 time_zone_offset_to_identifier(string $offset, int $offsetIndex = 0) { | |
| static $timeZoneOffsets = []; | |
| if (empty($timeZoneOffsets)) { | |
| foreach(timezone_identifiers_list() as $timeZoneIdentifier) { | |
| $dateTimeZone = new DateTimeZone($timeZoneIdentifier); | |
| $dateTime = new DateTime('NOW', $dateTimeZone); | |
| $timeZoneOffsets[$dateTimeZone->getOffset($dateTime)][] = $timeZoneIdentifier; | |
| } | |
| } |
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
| /** | |
| * Element.prototype.classList for IE8/9, Safari. | |
| * @author Kerem Güneş <[email protected]> | |
| * @copyright Released under the MIT License <https://opensource.org/licenses/MIT> | |
| * @version 1.2 | |
| * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/classList | |
| */ | |
| ;(function() { | |
| // Helpers. | |
| var trim = function(s) { |
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
| /** | |
| * To number format. | |
| * @param {Integer} decimals? | |
| * @param {String} decimalsSeparator? | |
| * @param {String} thousandsSeparator? | |
| * @return {String} | |
| * @links http://php.net/number_format, https://stackoverflow.com/q/2901102 | |
| */ | |
| Number.prototype.toNumberFormat = function(decimals, decimalsSeparator, thousandsSeparator) { | |
| decimalsSeparator = decimalsSeparator || '.'; |
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 copy_function($name) { | |
| $reflection = new ReflectionFunction($name); | |
| return function(...$arguments) use($reflection) { | |
| return call_user_func_array([$reflection, 'invoke'], $arguments); | |
| }; | |
| } | |
| $fn = copy_function('is_int'); |
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
Show hidden characters
| [ | |
| // Change font size with ctrl+scroll wheel | |
| { "button": "scroll_down", "modifiers": ["ctrl"], "command": "null" }, | |
| { "button": "scroll_up", "modifiers": ["ctrl"], "command": "null" } | |
| ] |
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
| [ | |
| { "keys": ["ctrl+q"], "command": "toggle_comment", "args": { "block": false } }, | |
| { "keys": ["ctrl+shift+q"], "command": "toggle_comment", "args": { "block": true } }, | |
| { "keys": ["ctrl+shift+e"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} }, | |
| { "keys": ["ctrl+shift+o"], "command": "prompt_open_folder" }, | |
| { "keys": ["ctrl+shift+h"], "command": "goto_documentation" }, | |
| // { "keys": ["ctrl+1"], "command": "fold_all" }, |
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
| { | |
| "added_words": | |
| [ | |
| "uber", | |
| "versioning" | |
| ], | |
| "always_show_minimap_viewport": true, | |
| "color_scheme": "Packages/Inspired GitHub Color Scheme/InspiredGitHub_2.tmTheme", | |
| "default_line_ending": "unix", | |
| "detect_indentation": 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
| def fn_slug(words): | |
| import re | |
| #global words | |
| chrs = {'ı':'i', 'ö':'o', 'ü':'u', 'ç':'c', 'ğ':'g', 'ş':'s', | |
| 'İ':'I', 'Ö':'O', 'Ü':'U', 'Ç':'C', 'Ğ':'G', 'Ş':'S'} | |
| def lower(word): | |
| return word.replace('İ', 'i').replace('I', 'ı').lower() |
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
| def fn_vector(words): | |
| import re, locale | |
| #global words | |
| def slug(words): | |
| return fn_slug(words) | |
| i = 0 | |
| dic = {} | |
| words = slug(words) |
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
| const crypto = require('crypto'); | |
| const util = require('util'); | |
| const Salt = { | |
| /** | |
| * Length. | |
| * @const int | |
| */ | |
| LENGTH: 128, |