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
# -*- coding: utf-8 -*- | |
# | |
# Used like this: | |
# | |
# from repermute import ipermute | |
# | |
# for s in ipermute('[A-Z]\d'): | |
# print s | |
# | |
# Almost all regular expression constructs are supported except for '*' |
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 | |
function isRegularExpression($string) { | |
set_error_handler(function() {}, E_WARNING); | |
$isRegularExpression = preg_match($string, "") !== FALSE; | |
restore_error_handler(); | |
return isRegularExpression; | |
} |
There are 2 ways to capture video streams, but both have the same source adb shell screenrecord
.
Important: device must be POWERFULL!
This will use "Raw frames". It can wait for user to continue
adb shell screenrecord --size=360x640 --output-format=raw-frames - | mplayer -demuxer rawvideo -rawvideo w=360:h=640:format=rgb24 -
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
// DISCLAIMER | |
// Original function was updated to a faster and es5-supporting version by @Quacky2200 | |
var replaceCircular = function(val, cache) { | |
cache = cache || new WeakSet(); | |
if (val && typeof(val) == 'object') { | |
if (cache.has(val)) return '[Circular]'; |