Skip to content

Instantly share code, notes, and snippets.

View georgestephanis's full-sized avatar

George Stephanis georgestephanis

View GitHub Profile
@georgestephanis
georgestephanis / strip_trailing_spaces.sql
Created August 17, 2012 16:20
Strip Trailing Spaces from MYSQL column
UPDATE `table`
SET `column` = TRIM( `column` )
WHERE `column` LIKE '% '
@georgestephanis
georgestephanis / login_page_mods.php
Created September 5, 2012 16:58
Login page mods for Dustin
<?php
add_action( 'login_head', 'my_login_head' );
function my_login_head(){
?>
<style>
html,body.login {background:#222;}
.login h1 a {background-image:url(<?php echo get_stylesheet_directory_uri() ?>/img/logo.png);}
.login form {box-shadow:none;}
.login #nav, .login #backtoblog {text-shadow:none;}
wp_enqueue_script( 'script-thing-000', site_url( 'foo-000.js' ) );
wp_enqueue_script( 'script-thing-001', site_url( 'foo-001.js' ) );
wp_enqueue_script( 'script-thing-002', site_url( 'foo-002.js' ) );
wp_enqueue_script( 'script-thing-003', site_url( 'foo-003.js' ) );
wp_enqueue_script( 'script-thing-004', site_url( 'foo-004.js' ) );
wp_enqueue_script( 'script-thing-005', site_url( 'foo-005.js' ) );
wp_enqueue_script( 'script-thing-006', site_url( 'foo-006.js' ) );
wp_enqueue_script( 'script-thing-007', site_url( 'foo-007.js' ) );
wp_enqueue_script( 'script-thing-008', site_url( 'foo-008.js' ) );
wp_enqueue_script( 'script-thing-009', site_url( 'foo-009.js' ) );
add_filter( 'admin_body_class', 'admin_body_class_post_type' );
function admin_body_class_post_type( $class ){
if ( $type = get_post_type() )
$class .= " post_type-$type";
return trim( $class );
}
if ( false === ( $hotfix_bps_deconcatenate = get_transient( 'hotfix_bps_deconcatenate' ) ) ) {
$loc = ABSPATH . '/wp-admin/.htaccess';
$match = 'RewriteCond %{QUERY_STRING} ^.*(\\[|\\]|\\(|\\)|<|>).* [NC,OR]';
if ( file_exists( $loc ) && ( -1 != strpos( file_get_contents( $loc ), $match ) ) {
set_transient( 'hotfix_bps_deconcatenate', ( $hotfix_bps_deconcatenate = 'do not concatenate' ), 3 * 60 );
} else {
set_transient( 'hotfix_bps_deconcatenate', 'clear skies', 3 * 60 );
}
}

#Chestnut Risotto - Level 1 ##Cooking Recommendation


##Abstract This recipe produces a risotto that has been described as "yummy". Because of it's heavy dependency on chestnuts, it is seasonable for December. Serves 4.

##Status of this Document This section describes the status of this recipe at the time of its publication. Other recipes may supersede this recipe, specially if it doesn't taste as good as it could.

##Conformance

<script>
jQuery(document).ready(function($){
$('#__cal_holder').load('/book-appointment/?l=<?php echo ('Appointment'==$_REQUEST['type'])?'NYC':str_replace('Appointment','',$_REQUEST['type']); /* IMPORTANT! For ?l=BOS the variable needs to be BOSAppointment and so on */ ?> .calendar_table');
$('.calendar_table thead a').live('click',function(e){
$('#__cal_holder')
.html('<h3 style="text-align:center;">Loading &hellip;</h3>')
.load('/book-appointment/'+$(this).attr('href')+' .calendar_table');
return false;
});
});
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `bills`
-- ----------------------------
DROP TABLE IF EXISTS `bills`;
CREATE TABLE `bills` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@georgestephanis
georgestephanis / legislation-import.php
Last active December 14, 2015 04:59
PHP Importer for Legislation.
<?php
# Before running this, use https://gist.github.com/georgestephanis/5032826 to build the db structure.
// The XML files this is meant to run over are sourced from
# http://thomas.loc.gov/home/gpoxmlc108/
# http://thomas.loc.gov/home/gpoxmlc109/
# http://thomas.loc.gov/home/gpoxmlc110/
# http://thomas.loc.gov/home/gpoxmlc111/
# http://thomas.loc.gov/home/gpoxmlc112/
--
-- Database: `legislation`
--
-- --------------------------------------------------------
--
-- Table structure for table `bills`
--