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 | |
class MockPhpStream | |
{ | |
protected $index = 0; | |
protected $length = null; | |
protected $data = ''; | |
public $context; |
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 | |
class MyClass { | |
public function myFunction($myParam) { | |
$callee = debug_backtrace(null, 2)[1]; | |
$method_string = $callee['class'].$callee['type'].$callee['function'].'('.implode(', ', $callee['args']).')'; | |
return $method_string; | |
} | |
} |
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
set number | |
set backspace=indent,eol,start | |
set shiftwidth=4 | |
set tabstop=4 | |
set autoindent | |
set selectmode=mouse | |
set cmdheight=2 | |
set nobackup | |
set nowritebackup | |
set ruler |
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 | |
$array = range(0,4); | |
$add = 10; | |
// Beware: importing variables (i.e. $add) copies the variable, you can out-out by value (i.e. &$add) | |
$array = array_map(function($value) use ($add) { | |
return $value + $add; | |
}, $array); | |
var_dump($array); |
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
{ | |
"require": { | |
"luracast/restler": "3.0.0-RC6", | |
"bshaffer/oauth2-server-php": "1.5", | |
"symfony/yaml": "2.5.5", | |
"rodneyrehm/plist": "2.0", | |
"luracast/restler": "3.0.0-RC6" | |
} | |
} |
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 | |
public class GermanPostalCodeToStateMap { | |
const STATE_BADEN_WUERTTEMBERG = 'Baden-Württemberg'; | |
const STATE_BAYERN = 'Bayern'; | |
const STATE_BERLIN = 'Berlin'; | |
const STATE_BRANDENBURG = 'Brandenburg'; | |
const STATE_BREMEN = 'Bremen'; | |
const STATE_HAMBURG = 'Hamburg'; | |
const STATE_HESSEN = 'Hessen'; |
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
Parameter #0 [ <required> BaseClass $baseClass ] | |
array(4) { | |
'type hinted class' => | |
string(9) "BaseClass" | |
'position' => | |
int(0) | |
'default value available?' => | |
bool(false) | |
'variable / param name' => | |
string(9) "baseClass" |
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
## Default project features settings | |
default_projects_features: | |
issues: {{PROJECT_DEFAULTS_ISSUES}} # can be true | false | |
merge_requests: {{PROJECT_DEFAULTS_MERGE_REQUESTS}} # can be true | false | |
wiki: {{PROJECT_DEFAULTS_WIKI}} # can be true | false | |
wall: {{PROJECT_DEFAULTS_WALL}} # can be true | false | |
snippets: {{PROJECT_DEFAULTS_SNIPPETS}} # can be true | false | |
visibility_level: "{{GITLAB_PROJECTS_VISIBILITY}}" # can be "private" | "internal" | "public" | |
## External issues trackers |
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 | |
class Internal { | |
public function whosGonnaCall() { | |
$backtrace = debug_backtrace(); | |
assert(is_array($backtrace)); | |
assert(is_array($backtrace[1])); | |
assert(isset($backtrace[1]['class'])); | |
$callerClass = $backtrace[1]['class']; | |
$thisClassName = get_class($this); |
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
// Open Settings directly for the app | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; |