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
| 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
| 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
| //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
| 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
| /* | |
| 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
| /** | |
| add custome meta box. | |
| * Calls the class on the post edit screen | |
| */ | |
| function call_someClass() | |
| { | |
| return new someClass(); | |
| } | |
| if ( is_admin() ) | |
| add_action( 'load-post.php', 'call_someClass' ); |
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
| /* | |
| add custom admin page; | |
| http://codex.wordpress.org/Function_Reference/add_menu_page | |
| */ | |
| add_action( 'admin_menu', 'register_my_custom_menu_page' ); | |
| function register_my_custom_menu_page(){ | |
| /* | |
| args: | |
| $page_title, |
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
| /* | |
| add custom admin setting tag & content; | |
| http://codex.wordpress.org/Administration_Menus | |
| */ | |
| /** Step 2 (from text above). */ | |
| add_action( 'admin_menu', 'my_plugin_menu' ); | |
| /** Step 1. */ | |
| function my_plugin_menu() { | |
| add_options_page( 'My Plugin Options', 'My Plugin', 'manage_options', 'my-unique-identifier', 'my_plugin_options' ); |
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
| // add custom role & capability | |
| add_action('admin_init', 'add_custom_role'); | |
| function add_custom_role() | |
| { | |
| $marketing = add_role('marketing', | |
| 'Marketing', | |
| array( | |
| 'read' => true, | |
| 'manage_links', |