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 | |
class Some_WP_Plugin { | |
/** | |
* Init everything here | |
*/ | |
public function __construct() { | |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); | |
add_filter( 'ajax_query_attachments_args', array( $this, 'filter_media' ) ); |
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
#include <stdio.h> | |
#include <string.h> | |
/* If you're feeling sassy, a macro one-liner w/out checks */ | |
#define substr(dest, src, dest_size, startPos, strLen) snprintf(dest, dest_size, "%.*s", strLen, src+startPos) | |
/* Python-like idiom of negative values to count from the end of the string. */ | |
void substr (char *dest, const char *src, int startPos, size_t strLen) { | |
/* Cannot do anything with NULL. */ | |
if (dest == NULL || src == NULL) return; |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
def scramble(unscrambled): | |
''' | |
Scrambles the word(s) in unscrambled such that the first and last letter remain the same, | |
but the inner letters are scrambled. Preserves the punctuation. | |
See also: http://science.slashdot.org/story/03/09/15/2227256/can-you-raed-tihs | |
''' | |
import string, random, re |
OlderNewer