Tiny Cross-browser DOM ready function in 111 bytes of JavaScript.
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
If you are running BIND as a resolver for your office - ie. not forwarding to another a resolver. | |
Flush everything in the cache: | |
rndc flush | |
Flush a specific record: | |
rndc flushname example.com | |
If you are forwarding then you are at the mercy of the forwarder's cache. |
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 | |
// A closure can be bound ($this will be a specific object), unbound ($this not set) or static ($this cannot be set) | |
// A closure may be scoped (it can see the private properties of a specific class), or unscoped (no class) | |
// At present, a closure must be bound or static if it is scoped, and unscoped if it is unbound | |
// I propose changing this to also allow scoped, unbound closures | |
// I want to add Closure::call, which lets you call and bind a closure (to avoid creating a new closure for each object you want to bind to) | |
$foo = function () { | |
return $this->x; |
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 | |
// Access a property with no restrictions | |
function stole($object,$property){ | |
$dict = (array)$object; | |
$class = get_class($object); | |
return isset($dict[$property])? | |
$dict[$property]:(isset($dict["\0*\0$property"])? | |
$dict["\0*\0$property"]:(isset($dict["\0$class\0$property"])? | |
$dict["\0$class\0$property"]: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
# Bug | |
# FATAL ERROR: JS Allocation failed - process out of memory | |
- var n = 0 | |
ul | |
while n < 20 | |
= n++ |
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
$reader = function($object, $property) { | |
$value = \Closure::bind(function() use($property) { | |
return $this->$property; | |
}, $object, $object)->__invoke(); | |
return $value; | |
}; | |
print_r( $reader($this, 'created') ); |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
-
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
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
$ curl -O ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz | |
$ tar -xzvf ncurses-5.9.tar.gz | |
$ cd ./ncurses-5.9 | |
$ ./configure --prefix=/usr/local \ | |
--without-cxx --without-cxx-binding --without-ada --without-progs --without-curses-h \ | |
--with-shared --without-debug \ | |
--enable-widec --enable-const --enable-ext-colors --enable-sigwinch --enable-wgetch-events \ | |
&& make | |
$ sudo make install |
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 array_map_recursive(callable $func, array $arr) { | |
array_walk_recursive($arr, function(&$v) use ($func) { | |
$v = $func($v); | |
}); | |
return $arr; | |
} |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/