Skip to content

Instantly share code, notes, and snippets.

View jingoro's full-sized avatar

John Nishinaga jingoro

View GitHub Profile
dscacheutil -flushcache
#!/usr/bin/env perl
$field =~
m/^(
[\x09\x0A\x0D\x20-\x7E] # ASCII
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
| \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
@jingoro
jingoro / gist:272739
Created January 9, 2010 05:34
YUI3 node-visibility
YUI().add('node-visibility', function(Y) {
Y.mix(Y.DOM, {
visible: function(node) {
return Y.DOM.getStyle(node, 'display') != 'none';
},
toggle: function(node) {
Y.DOM.visible(node) ? Y.DOM.hide(node) : Y.DOM.show(node);
},
hide: function(node) {
Y.DOM.setStyle(node, 'display', 'none');