Skip to content

Instantly share code, notes, and snippets.

View moskowite's full-sized avatar

Tyler Moskowite moskowite

View GitHub Profile
<tr>
<td valign="top" colspan="2">
What position / area are you interested in working? <b>Please select at least three.</b> (<b><a href="http://makezine.com/makerfaire/bayarea/2012/maker-in-training/roles.csp" onClick="window.open('http://makezine.com/makerfaire/bayarea/2012/maker-in-training/roles.csp','Popup','toolbar=no,width=600,height=600,status=no,location=no,scrollbars=yes,resizable=yes,menubar=yes');return false">Click here for detailed descriptions</a></b>)<span class="red">*</span><br />
<csinputfield name="mfarea" required="yes" cols="1" optionorder="setup,playday,swap,bookstore,info,reuse,checkin,maker,crafter,runner,crowd,edu"><span class="margin-left: 16px;">If other, please describe: <csinputfield name="question2" rows="1"></span>
</td>
</tr>
<?php
/*
Plugin Name: Make Project's oEmbed
Plugin URI: http://makeprojects.com/
Description: Embed a Make Project into your Wordpress blog, just copy and paste the URL of the project (e.g. http://makeprojects.com/Project/Build-a-Makerspace/1390/1 ). This plugin will automatically embed using wp_oembed_add_provider. Enjoy a interactive Make Project's experience right in your blog.
Author: whyisjake, tmoskowite
Version: 1.0
Author URI: www.makezine.com
*/
add_action( 'init', 'makeblog_check_contribute');
function makeblog_check_contribute(){
if( is_page('contribute') ){
add_action( 'init', 'makeblog_process_post' );
add_action('wp_enqueue_scripts', 'makeblog_contribute_script');
}
}
function makeblog_contribute_script() {
package com.android.systemui.statusbar.powercontrols;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.net.Uri;
@moskowite
moskowite / gist:1830998
Created February 14, 2012 22:16
Crafters post type
<?php
add_action( 'init', 'register_cpt_crafter' );
function register_cpt_crafter() {
$labels = array(
'name' => _x( 'Crafters', 'crafter' ),
'singular_name' => _x( 'Crafter', 'crafter' ),
<script language="JavaScript" type="text/javascript">
<!--
var name = "binka";
var domain = "oreilly.com";
var display = "";
var subject = "";
var ending = "";
var style = "";
document.write('<a class="' + style + '" href="mailto:' + name + '&#64;' + domain + '?subject=' + subject + '">');
if (display) {
@moskowite
moskowite / gist:1757043
Created February 7, 2012 03:48
VolumePanel.java
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@moskowite
moskowite / gist:1731965
Created February 3, 2012 19:39
get-prebuilts
mkdir -p `dirname $0`/proprietary
# Get Android Terminal Emulator (we use a prebuilt so it can update from the Market)
curl -L -o `dirname $0`/proprietary/Term.apk -O -L https://github.com/downloads/jackpal/Android-Terminal-Emulator/Term.apk
unzip -o -d proprietary proprietary/Term.apk lib/armeabi/libjackpal-androidterm3.so
<?php
function __update_post_meta( $post_id, $field_name, $value = '' ) {
if ( empty( $value ) OR ! $value ) {
delete_post_meta( $post_id, $field_name );
} elseif ( ! get_post_meta( $post_id, $field_name ) ) {
add_post_meta( $post_id, $field_name, $value );
} else {
update_post_meta( $post_id, $field_name, $value );
}
<?php
function __update_post_meta( $post_id, $field_name, $value = '' ) {
if ( empty( $value ) OR ! $value ) {
delete_post_meta( $post_id, $field_name );
} elseif ( ! get_post_meta( $post_id, $field_name ) ) {
add_post_meta( $post_id, $field_name, $value );
} else {
update_post_meta( $post_id, $field_name, $value );
}