Skip to content

Instantly share code, notes, and snippets.

View carter2422's full-sized avatar

Jonathan Williamson carter2422

View GitHub Profile
@carter2422
carter2422 / __init__.py
Last active December 19, 2015 01:49
Quick Tools add-on
bl_info = {
"name": "Quick Tools",
"description": "A series of tools and menus to enhance and speed up workflow",
"author": "Jonathan Williamson",
"version": (0, 8),
"blender": (2, 6, 7),
"location": "View3D - 'Q' key gives a menu in Object, Edit, and Sculpt modes.",
"warning": '', # used for warning icon and text in addons panel
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/quicktools",
"tracker_url": "https://github.com/CGCookie/script-bakery/issues",
@carter2422
carter2422 / __init__.py
Created June 29, 2013 04:19
Quick Tools __init__.py with keymap addon preferences.
bl_info = {
"name": "Quick Tools",
"description": "A series of tools and menus to enhance and speed up workflow",
"author": "Jonathan Williamson",
"version": (0, 8),
"blender": (2, 6, 7),
"location": "View3D - 'Q' key gives a menu in Object, Edit, and Sculpt modes.",
"warning": '', # used for warning icon and text in addons panel
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/quicktools",
"tracker_url": "https://github.com/CGCookie/script-bakery/issues",
@carter2422
carter2422 / operator_modal.py
Created January 29, 2014 21:38
Quick Modifiers Modal
import bpy
from bpy.props import IntProperty, FloatProperty
class ModalOperator(bpy.types.Operator):
"""Move an object with the mouse, example"""
bl_idname = "object.modal_operator"
bl_label = "Simple Mirror"
first_mouse_x = IntProperty()
function cgc_mixpanel_js() {
global $user_login;
get_currentuserinfo();
?>
<!-- Mixpanel -->
<script type="text/javascript">
(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===e.location.protocol?"https:":"http:")+'//cdn.mxpnl.com/libs/mixpanel-2.2.min.js';f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f);b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==
@carter2422
carter2422 / mixpanel-false-expiration
Created April 8, 2014 18:48
Getting a 'false' expiration on Membership Payment events
// Track account upgrade via gift redemption
function cgc_rcp_track_payment( $payment_id = 0, $args = array(), $amount ) {
if( ! function_exists( 'rcp_get_subscription_name' ) )
return;
global $wpdb;
$mp = Mixpanel::getInstance( CGC_MIXPANEL_API );
@carter2422
carter2422 / gist:11261176
Last active August 29, 2015 14:00
Account Upgrade
// Track account upgrade
function cgc_rcp_account_upgrade( $user_id, $data ) {
if( ! function_exists( 'rcp_get_subscription_name' ) )
return;
$mp = Mixpanel::getInstance( CGC_MIXPANEL_API );
$user = get_userdata( $user_id );
<?php
/*
Plugin Name: Show Posts Short Code
Version: 0.0.1
Author: Jonathan Williamson
*/
function jonathan_show_posts_shortcode($atts, $content = null ) {
// Track account upgrade
function cgc_rcp_account_upgrade( $user_id, $data ) {
if( ! function_exists( 'rcp_get_subscription_name' ) )
return;
$mp = Mixpanel::getInstance( CGC_MIXPANEL_API );
$user = get_userdata( $user_id );
@carter2422
carter2422 / blender_keymap_default
Created November 9, 2014 18:00
This is the default keymap for Blender.
import bpy
import os
def kmi_props_setattr(kmi_props, attr, value):
try:
setattr(kmi_props, attr, value)
except AttributeError:
print("Warning: property '%s' not found in keymap item '%s'" %
(attr, kmi_props.__class__.__name__))
except Exception as e:
@carter2422
carter2422 / alternate-unhide
Last active August 29, 2015 14:10
Unhide objects and keep them unselected.
bl_info = {
"name": "Alternate Object Hiding",
"author": "Jonathan Williamson",
"version": (1, 0),
"blender": (2, 65, 0),
"location": "View3D",
"description": "Unhides objects while keeping them deselected",
"warning": "",
"wiki_url": "",
"category": "Object"}