This file contains 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 | |
trait DocInject | |
{ | |
public function parseDocInject() | |
{ | |
$reflection = new ReflectionClass($this); | |
foreach ($reflection->getProperties() as $property) { | |
$this->processProperty($property); | |
} | |
} |
This file contains 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 DocInject | |
{ | |
public function __construct() | |
{ | |
$reflection = new ReflectionClass($this); | |
foreach ($reflection->getProperties() as $property) { | |
$this->processProperty($property); | |
} | |
} |
This file contains 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
class Dummy | |
@helloStatic: (name)-> | |
"hello #{name} (static)" | |
hello: (name) -> | |
"hello #{name}" | |
alert Dummy.helloStatic("Gonzalo") | |
dummy = new Dummy |
This file contains 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
cd existing_git_repo | |
git remote add origin git@github.com:[user]/[reponame].git | |
git push -u origin master |
This file contains 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
//js.php | |
require 'jsmin.php'; | |
function checkCanGzip(){ | |
if (array_key_exists('HTTP_ACCEPT_ENCODING', $_SERVER)) { | |
if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) return "gzip"; | |
if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false) return "x-gzip"; | |
} | |
return false; | |
} |
NewerOlder