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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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
#!/bin/bash | |
# | |
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html) | |
# modified by [email protected] | |
# modified by aconway@[redacted] - handle diffs that introduce new files | |
# modified by [email protected] - fixes diffs that introduce new files | |
# modified by [email protected] - fix sed syntax issue in OS X | |
# | |
# Generate an SVN-compatible diff against the tip of the tracking branch |
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: AntiScript deamon | |
Plugin URI: https://github.com/franz-josef-kaiser | |
Description: Removes script-links to spam sites from your post content after your site got hacked. Please go to <a href="tools.php?page=script_deamon.php">Tools → Remove Hack</a>. Thank you. Proudly brought to you by <a href="http://example.com">Franz Josef Kaiser</a>. | |
Version: 0.1 | |
Author: Franz Josef Kaiser | |
Author URI: https://github.com/franz-josef-kaiser | |
License: GPL2 | |
WP-Version: Tested in 2.7.1, 2.9.2, 3.0 |
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
<?php | |
/** | |
* Callback for wp_list_comments() | |
* @param object $comment | |
* @param array $args | |
* @param int $depth | |
* @return void | |
*/ | |
function extra_comment_callback( $comment, $args, $depth ) | |
{ |
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 html5_video( $atts, $content = NULL ) { | |
extract( shortcode_atts( array( | |
"src" => '', | |
"width" => '', | |
"height" => '' | |
), $atts ) ); | |
return '<video src="' . $src . '" width="' . $width . '" height="' . $height . '" controls autobuffer>'; | |
} | |
add_shortcode( 'video5', 'html5_video' ); | |
Now you can use the following shortcode in your post: |
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 fb_show_shortcodes( $atts, $content = NULL ) { | |
extract( shortcode_atts( | |
array('linebreak'=>''), | |
$atts | |
) ); | |
$brackets = array(); | |
$brackets[0] = "/\[/"; | |
$brackets[1] = "/\]/"; |
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
#################################### | |
# BASIC REQUIREMENTS | |
# http://graphite.wikidot.com/installation | |
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
# Last tested & updated 10/13/2011 | |
#################################### | |
sudo apt-get update | |
sudo apt-get upgrade |
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 | |
/* | |
TESTING: | |
http://programmers.stackexchange.com/questions/120378/is-error-suppression-acceptable-in-role-of-logic-mechanism/120386#120386 | |
Elapsed Time[µseconds] | |
Check, Exists : | |
50000 - Check, Exists : 94718 (user), 342 (system) | |
EACH - Check, Exists : 1.89436E-6 (user), 6.84E-9 (system) |
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
#!/usr/bin/python | |
import inspect | |
from functools import wraps | |
from collections import defaultdict | |
# This time, we'll avoid using a class to hold the namespace. We'll just use | |
# the class that the functions are being defined in. | |
# AS A BONUS | |
# This means that it works for module-level functions, not just methods! |
OlderNewer