Skip to content

Instantly share code, notes, and snippets.

@tnydwrds
tnydwrds / fixOrthoCameraClippingPlanes.mel
Created January 15, 2018 04:01
Dirty MEL script to fix odd orthographic camera clipping planes with some scene units in Maya LT
/**
* Fix for system orthographic camera clipping planes not taking into account
* scene unit changes from centimeters.
*/
global proc foccp_fixOrthoCameraClippingPlanes() {
float $offset_amount = 100,
$near_clip_plane,
$far_clip_plane,
$cur_far_clip_plane,
$center_of_interest;
@tnydwrds
tnydwrds / GameScene.m
Last active August 29, 2015 14:18
Line Example - Updates to someone's code demonstrating how to extend a line beyond touch location and for me to learn some trigonometry.
#import "GameScene.h"
@implementation GameScene {
SKShapeNode *line; // Declaration of the SKShapeNode "line".
// I thought storing a starting point was more convenient than calculating it in drawLine:.
CGPoint startingPoint;
CGFloat lineLength;
@tnydwrds
tnydwrds / cookie_with_list_value.js
Created September 26, 2012 00:32
Setting targetable OXE cookies client-side
@tnydwrds
tnydwrds / jquery_transport.js
Created October 14, 2011 15:51
Quick jQuery Transport sample
// This is currently just a proof of concept. My OAuth usage requires setting
// a cookie client-side (server does not do this) after successful authentication.
// AIR runtime does not allow XHR to set cookie header so I had to use AIR's
// URLRequest object.
//
// I imagine you can do the same thing but use jsOAuth.request or something in
// place of URLRequest
//
// http://api.jquery.com/extending-ajax/#Transports
@tnydwrds
tnydwrds / get_afr_count.py
Created August 20, 2011 02:57
Scrape one level of links on a site for OpenX 2.8 afr tags
#!/usr/bin/env python
import re
import urllib2
log_message = '"%s",%d,"%s"'
print('"url","num_of_afrs","zones"')
def get_zones(htmldoc):
return set(re.findall('<iframe.+?src=["\'].+?afr\.php.+?zoneid=(\d+).*?["\'].+?>',htmldoc))
@tnydwrds
tnydwrds / unlink_banners.rb
Created June 17, 2011 08:18
Unlink banners from multiple advertisers in OpenX 2.8
@tnydwrds
tnydwrds / opun.py
Created June 10, 2011 06:07
opun.py - open with default app and keep file associations
#!/usr/bin/env python
import optparse
import os
import sys
# Change this to whatever app you want to open by default.
DEFAULT_APP = "Coda"
def main(args):
@tnydwrds
tnydwrds / deactivate_campaigns.py
Created June 10, 2011 04:00
Bulk deactivation of OpenX 2.8 Source campaigns
#!/usr/bin/env python
import csv
import datetime
import xmlrpclib
csv_file_path = "campaigns_to_deactivate.csv"
username = ""
password = ""
domain = ""