View uninitialized stuff
// Java | |
class Foo { Integer i; } | |
class Test { | |
public static void main(String args[]) { | |
System.out.println(new Foo().i == null); | |
} | |
} | |
// JavaScript |
View nö.php
<?php | |
// ok, cos converted to ?int = null, right? | |
function foo(int $i = null) {} | |
// ok, all ok, right? | |
$a = new class { | |
public $i; | |
public function check(): bool { | |
return ($this->i != null); | |
} |
View Default (Linux).sublime-mousemap
[ | |
// Change font size with ctrl+scroll wheel | |
{ "button": "scroll_down", "modifiers": ["ctrl"], "command": "null" }, | |
{ "button": "scroll_up", "modifiers": ["ctrl"], "command": "null" } | |
] |
View Preferences.sublime-settings
{ | |
"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, |
View fn_vector.py
def fn_vector(words): | |
import re, locale | |
#global words | |
def slug(words): | |
return fn_slug(words) | |
i = 0 | |
dic = {} | |
words = slug(words) |
View fn_slug.py
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() |
View InspiredGitHub_2.tmTheme
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<!-- | |
Inspired GitHub Color Scheme for Sublime Text 3 | |
Copyright 2015 Seth Lopez | |
Released under the MIT License <http://opensource.org/licenses/MIT> | |
https://github.com/sethlopezme/InspiredGitHub.tmtheme | |
--> | |
<!-- | |
ed6a43 > this |
View copy_function.php
<?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'); |
View Number.prototype.toNumberFormat.js
/** | |
* 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 || '.'; |
View date_time_stuff.php
<?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; | |
} | |
} |