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
gource --user-image-dir .git/avatar/ --max-file-lag 3 --seconds-per-day 1 --hide filenames,mouse,progress -1024x768 -o - | ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -vpre /usr/share/ffmpeg/libx264-lossless_slow.ffpreset -threads 0 gource.mp4 |
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
//Ref: http://codex.wordpress.org/Function_Reference/the_editor | |
//== how to add TinyMCE wysiwyg to your custom textarea plugin == | |
the_editor($content, $id, $prev_id, $media_buttons, $tab_index, $extended); |
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
<!-- Start Additional Resoruce Loop --> | |
<?php | |
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; | |
$args = array( | |
'post_type' => 'additionalresource', | |
'posts_per_page' => 10, | |
'paged' => $paged, | |
'orderby' => 'date', | |
); | |
$the_query = new WP_Query( $args ); |
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
<?php | |
/* | |
Plugin Name: Disable plugins when doing local dev | |
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify | |
Version: 0.1 | |
License: GPL version 2 or any later version | |
Author: Mark Jaquith | |
Author URI: http://coveredwebservices.com/ | |
*/ |
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
var confirmDel = confirm("Are you sure? This is your last chance!"); | |
if(confirmDel === true) | |
{ | |
return true; | |
} else { | |
return false; | |
} |
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
//find all with permission 777 | |
find / -type f -perm 0777 | |
//find all without permission 777 | |
find / -type f ! -perm 0777 | |
//Wordpress chmod permission | |
define('FS_METHOD', 'direct'); |
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
#Creating an archive using tar command | |
*c – create a new archive | |
*v – verbosely list files which are processed. | |
*f – following is the archive file name | |
*z – filter the archive through gzip | |
Note: .tgz is same as .tar.gz | |
//compress | |
tar cvf archive_name.tar dirname/ |
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
CREATE VIEW `table_view` | |
AS | |
select | |
* | |
from | |
table | |
where | |
id=... |
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
var normal = document.querySelector('.normal'), | |
prevent = document.querySelector('.prevent'); | |
prevent.addEventListener('click', function(ev) { | |
alert('fabulous, really!'); | |
ev.preventDefault(); | |
}, false); | |
normal.addEventListener('click', function(ev) { | |
alert('fabulous, really!'); |
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
function isNumberKey(evt) | |
{ | |
var charCode = (evt.which) ? evt.which : event.keyCode | |
if (charCode > 31 && (charCode < 48 || charCode > 57)) | |
return false; | |
return true; | |
} | |
<input type="text" onkeypress="return isNumberKey(event)" maxlength="5" placeholder="Search by Zip" id="addressInput"> |