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 | |
// source http://www.catswhocode.com/blog/snippets/creating-zip-file-with-php | |
$error = ""; //error holder | |
if(isset($_POST['createpdf'])){ | |
$post = $_POST; | |
$file_folder = "files/"; // folder to load files | |
if(extension_loaded('zip')){ // Checking ZIP extension is available | |
if(isset($post['files']) and count($post['files']) > 0){ // Checking files are selected | |
$zip = new ZipArchive(); // Load zip library | |
$zip_name = time().".zip"; // Zip name |
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
scp someFile someUser@someServer:/somePath/someFile |
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
function nc_opt_list_communes() { | |
$options = array( | |
'98812' => 'Boulouparis', | |
'98870' => 'Bourail', | |
'98813' => 'Canala', | |
'98830' => 'Dumbéa', | |
'98881' => 'Farino', | |
'98815' => 'Hienghène', | |
'98816' => 'Houaïlou', | |
'98811' => 'îles Belep', |
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
//http://wp.tutsplus.com/tutorials/theme-development/creating-a-wordpress-post-text-size-changer-using-jquery/ | |
// This prevents the execution of the code before the document is finished loading. | |
jQuery(document).ready(function() { | |
// The 'A+' element in the page is associated with the jQuery click() event. | |
jQuery('#increase-font').click(function(event) { | |
// This prevents the default action of the click() event from being triggered. | |
event.preventDefault(); | |
// The jQuery each() event interates over each elements belonging to the 'resize' class | |
jQuery('.resize').each(function() { | |
// Call to a custom function to increase the text size |
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
# Remove all files and directories (recursive removal) | |
rm -rf path/to/folder | |
# Remove / Delete directory called /tmp/foo | |
rmdir /tmp/foo |
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
cat video1.avi video2.avi videon.avi > output.avi (this merges them but only playes length of 1st mov) | |
mencoder -forceidx -oac copy -ovc copy output.avi -o output_final.avi (this commands rebuilds the header file. One unqiue point about this commands is that it only copies the frames and audio across, it doesn’t re-encode them ) |
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
<h1>Split view feature box with CSS skew transform and transitions</h1> | |
<div class="box sunrise"><a href="#box2"></a></div> | |
<div class="slider"> | |
<div class="box sunset"><a href="#box1"></a></div> | |
</div> | |
<footer> | |
<p>Handcrafted by <a href="http://www.twitter.com/dstorey">@dstorey</a> for | |
<a href="http://www.generatedcontent.org/123456/split-feature">GeneratedContent.org</a>. Sunset image, <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/">Some rights reserved</a> by <a href="http://www.flickr.com/photos/42429527@N03/">najeebkhan2009</a>. Sunrise image, <a href="http://creativecommons.org/licenses/by-nd/2.0/">Some rights reserved</a> by <a href="http://www.flickr.com/photos/petehogan/">3dpete</a>.</p> | |
</footer> |
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 | |
/* | |
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 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
Drupal.settings.nid = Drupal.settings.nid || []; | |
Drupal.settings.getAllFeature; | |
function my_map() { | |
var all_layers = Drupal.openlayers.popup.popupSelect.layers; | |
for(var key1 in all_layers) { | |
var current_layer = all_layers[key1]; | |
var all_features_in_layer = current_layer.features; | |
for(var key2 in all_features_in_layer) { |
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
foreach( get_categories('hide_empty=1') as $cat ) : | |
if( !$cat->parent ) { | |
echo '<ul><li><strong>' . $cat->name . '</strong></li>'; | |
process_cat_tree( $cat->term_id ); | |
} | |
endforeach; | |
wp_reset_query(); //to reset all trouble done to the original query | |
// | |
function process_cat_tree( $cat ) { |
NewerOlder