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
// pxi: pixels in image scale | |
// pxc: pixels in crop scale | |
// Helper function to create an element with optional attributes | |
// Doesn't jQuery already have this? | |
Monkeyman_FixedImageCroppper_createElement = function(tagName, attr) | |
{ | |
if (!attr) { | |
attr = {}; | |
} |
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/sh -x | |
# script by Stephanie Booth aka bunny http://stephanie-booth.com/ to install wordpress automatically (geeky, but useful for mass installs), with help from many people: drauh, io_error, zedrdave, roddie... and all those I've forgotten to mention. | |
# variables: $1 whatever, $2 wp_user, $3 wp_pass, $4 root password | |
# prerequisites: an existing mysql db, and a root password | |
# care! .htaccess is not generated, needs to be done manually, by clicking on "Update Permalinks" in Options once everything is installed | |
# todo: add themes, check plugin list, make wrapper script for multiple installs, prepare php patch template for options and common stuff, see if the script can edit the vhost conf files for mass installs, prepare alternate version for French, add bilingual plugin and maybe cache. Add an extra user to the WP install. Also an alternate version for upgrading the school blogs. |
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
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style> | |
ul { float:left; margin-right:20px; } | |
body { color:white; font-family:Helvetica, sans-serif; text-shadow:1px 1px 1px rgba(0,0,0,0.2); } | |
ul { width:512px; overflow:hidden; border-radius:6px; } |
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
/////////////////////////////////////////////////////////////////////////////////////////// | |
// CODE TO ADD POST PER PAGE FILTER | |
/////////////////////////////////////////////////////////////////////////////////////////// | |
add_filter( 'edit_posts_per_page', 'reorder_edit_posts_per_page', 10, 2 ); | |
function reorder_edit_posts_per_page( $per_page, $post_type ) { | |
// CHECK USER PERMISSIONS | |
if ( !current_user_can('edit_others_pages') ) | |
return; | |
$post_type_object = get_post_type_object( $post_type ); |
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 | |
/** | |
* Example for writing a WP plugin that adds a custom post type and flushes | |
* rewrite rules only once on initialization. | |
*/ | |
/** | |
* On activation, we'll set an option called 'my_plugin_name_flush' to true, | |
* so our plugin knows, on initialization, to flush the rewrite rules. | |
*/ |
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
marker.animate('rotate', [0], [-Math.PI * 2], { | |
easing: 'sine.inout' | |
}); | |
marker.animate('translate', [0, 0], [0, -40], { | |
easing: 'sine.in', | |
duration: 500, | |
complete: function() { | |
marker.animate('translate', [0, -40], [0, 0], { | |
duration: 500 |
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
declare -A FIPS | |
declare -A STNAME | |
FIPS[AK]=02; STNAME[AK]=Alaska | |
FIPS[AL]=01; STNAME[AL]=Alabama | |
FIPS[AR]=05; STNAME[AR]=Arkansas | |
FIPS[AS]=60; STNAME[AS]=American Samoa | |
FIPS[AZ]=04; STNAME[AZ]=Arizona | |
FIPS[CA]=06; STNAME[CA]=California | |
FIPS[CO]=08; STNAME[CO]=Colorado | |
FIPS[CT]=09; STNAME[CT]=Connecticut |
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 | |
# A little Bash script to make a mirror of your Github repositories and keep | |
# them up-to-date. | |
# Why mirroring? Because I can! | |
# Also, it will be very useful if one day a meteorite crashes into Github | |
# servers (even if it will not happen). | |
# https://gist.github.com/950441 |