Skip to content

Instantly share code, notes, and snippets.

View bendalton's full-sized avatar

Ben Dalton bendalton

View GitHub Profile
@bendalton
bendalton / break_even.mxml
Created October 26, 2011 15:42
BREAK-EVEN AREA CHART WITH FLEX
<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="generateChartData()">
<mx:Script><![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var chartData:ArrayCollection;
public function generateChartData():void
{
javascript:(function() %7B%0A var location %3D window.location %2B ""%3B%0A var loc %3D location.split("%2F")%3B%0A loc.length %3D 3%3B%0A var baseUrl %3D loc.join("%2F")%3B%0A if(baseUrl.match("accounts%5C.google%5C.com"))%7B%0A window.location %3D "https%3A%2F%2Fconsole.developers.google.com%2Fapis%2Fcredentials%2Foauthclient%2F610022916260-k8n7s5nv60o9r0jeosessf7f1jq8hda6.apps.googleusercontent.com%3Fproject%3D610022916260"%3B%0A %7Delse%7B%0A tryUnityUrl(baseUrl)%3B%0A %7D%0A%0Afunction tryUnityUrl(baseUrl)%7B%0A var l %3D new jsLoader()%3B%0A var testUrl %3D baseUrl %2B "%2Fconfig.js"%3B%0A l.require(testUrl%2C800%2Ctrue%2Cfunction()%7B%0A goSSO(baseUrl)%0A %7D%2Cfunction()%7B%0A var newUrl %3D prompt("Looks like you aren%27t on a Unity site%2C enter the site you are trying to reach (e.g.%2C demo.rideamigos.com)")%3B%0A if(!newUrl.match("https")) newUrl %3D "https%3A%2F%2F"%2BnewUrl%3B%0A tryUnityUrl(newUrl)%3B%0A %7D)%0A%7D%0A%0Afunction isUnitySite(baseUrl%2Ccallback)%7B%0
@bendalton
bendalton / fraud.md
Created March 18, 2019 15:32
CATS notes

CATS - Fraud Prevention

Fundamentally automated fraud detection is hard. Disabling the immediate redemption capability is the best initial step which we've taken.

For ongoing fraud detection/prevention, providing an approval process with tools to manually identify potential fraud and take actions to restict that user's access.

What have we done

  • prevent backdating trips from before registration