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
| /* | |
| Disable content editor for specific page template | |
| */ | |
| add_action('admin_init', 'hide_editor'); | |
| function hide_editor() { | |
| $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID']; | |
| if (!isset($post_id)) return; | |
| $template_file = get_post_meta($post_id, '_wp_page_template', true); |
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
| http://johndyer.name/ffmpeg-settings-for-html5-codecs-h264mp4-theoraogg-vp8webm/ | |
| REM mp4 (H.264 / ACC) | |
| ffmpeg -i %1 -b 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 -s 640x360 %1.mp4 | |
| REM webm (VP8 / Vorbis) | |
| ffmpeg -i %1 -b 1500k -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30 -s 640x360 %1.webm | |
| REM ogv (Theora / Vorbis) | |
| ffmpeg -i %1 -b 1500k -vcodec libtheora -acodec libvorbis -ab 160000 -g 30 -s 640x360 %1.ogv | |
| REM jpeg (screenshot at 10 seconds) | |
| ffmpeg -i %1 -ss 00:10 -vframes 1 -r 1 -s 640x360 -f image2 %1.jpg |
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
| //http://stackoverflow.com/questions/16889447/prevent-full-page-scrolling-ios | |
| elem.addEventListener('touchstart', function(event){ | |
| this.allowUp = (this.scrollTop > 0); | |
| this.allowDown = (this.scrollTop < this.scrollHeight - this.clientHeight); | |
| this.prevTop = null; this.prevBot = null; | |
| this.lastY = event.pageY; | |
| }); | |
| elem.addEventListener('touchmove', function(event){ |
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
| void testApp::drawSkew(ofImage * src, ofPoint * tl, ofPoint * tr, ofPoint * br, ofPoint * bl) { | |
| // tl,tr,br,bl = normalized 0.-1. | |
| ofSetColor(255); | |
| src->reloadTexture(); | |
| //src->draw(0,0); | |
| //ofDisableArbTex(); | |
| src->getTextureReference().bind(); | |
| // glEnable(GL_TEXTURE_2D); | |
| glMatrixMode(GL_TEXTURE); | |
| glPushMatrix(); |
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
| glEnable(GL_BLEND); | |
| //glBlendFuncSeparate(GL_ONE, GL_SRC_COLOR, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); | |
| glBlendFuncSeparate(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA,GL_ONE,GL_ONE_MINUS_SRC_ALPHA); | |
| //draw | |
| glDisable(GL_BLEND); |
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
| ffmpeg -i "%1" -vcodec copy -acodec pcm_s16le -ac 2 "%1.mov" |
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
| property ffplay : "/usr/local/bin/ffplay" | |
| on main(input) | |
| do shell script ffplay & space & quoted form of input | |
| end main | |
| on open argv | |
| repeat with aFile in argv | |
| main(POSIX path of aFile) | |
| end repeat |
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
| property ffplay : "/Applications/ffmpeg/ffplay" | |
| on main(input) | |
| do shell script ffplay & space & quoted form of input | |
| end main | |
| on open argv | |
| repeat with aFile in argv | |
| main(POSIX path of aFile) | |
| end repeat |
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
| // The "callback" argument is called with either true or false | |
| // depending on whether the image at "url" exists or not. | |
| function imageExists(url, callback) { | |
| var img = new Image(); | |
| img.onload = function() { callback(true); }; | |
| img.onerror = function() { callback(false); }; | |
| img.src = url; | |
| } | |
| // Sample usage |
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
| @echo off | |
| :: app_restart.bat | |
| :: %1 path of application | |
| :loop | |
| tasklist /fi "Status eq NOT RESPONDING" | findstr %~nx1 | |
| if %errorlevel%==0 ( |