This config works for me with the following setup, YMMV
- OSX El Capitain
- PHPStorm 2016.2.1
- Lumen 5.2
- Homestead as of Lumen 5.2
- php 7.0.8-2
- Xdebug 2.4.0
| <?php | |
| /* | |
| I wrote this function to progressively obfuscate text in MAKEbook.io. When it KINDA worked, I just used it. | |
| It can take a lot of improvement. I kinda just tweaked the values until it was good enough. It's not SO progressive though. | |
| It takes all the output of your PHP scripts via ob_start(), reroutes that to the obfuscation function. | |
| You should check if user paid for book or not, then either run ob_start or not! | |
| ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4 |
| launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist | |
| sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist | |
| sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz | |
| sudo pkgutil --forget org.macosforge.xquartz.pkg | |
| # Log out and log in |
| -- Adapted from these sources: | |
| -- http://peterdowns.com/posts/open-iterm-finder-service.html | |
| -- https://gist.github.com/cowboy/905546 | |
| -- | |
| -- Modified to work with files as well, cd-ing to their container folder | |
| on run {input, parameters} | |
| tell application "Finder" | |
| set my_file to first item of input | |
| set filetype to (kind of (info for my_file)) | |
| -- Treats OS X applications as files. To treat them as folders, integrate this SO answer: |
| //www.lsauer.com 2012 | |
| //Answer to: | |
| //http://stackoverflow.com/questions/881085/count-the-number-of-occurances-of-a-character-in-a-string-in-javascript/10671743#10671743 | |
| //There are at least four ways. The best option, which should also be the fastest -owing to the native RegEx engine -, is placed at the top. //jsperf.com is currently down, otherwise I would provide you with performance statistics. | |
| #1. | |
| ("this is foo bar".match(/o/g)||[]).length | |
| //>2 | |
| #2. | |
| "this is foo bar".split("o").length-1 |