Skip to content

Instantly share code, notes, and snippets.

View bendalton's full-sized avatar

Ben Dalton bendalton

View GitHub Profile
@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
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 / 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
{
@bendalton
bendalton / Example.mxml
Created October 20, 2011 19:32
HTTPService Example
<?xml version="1.0" encoding="utf-8"?>
<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" minWidth="955" minHeight="600">
<fx:Declarations>
<s:HTTPService id="service" url="http://yoururl.com/file/blah" resultFormat="text"/>
</fx:Declarations>
<s:layout>
<s:VerticalLayout/>
</s:layout>
@bendalton
bendalton / gist:1197987
Created September 6, 2011 16:05
javascript for CF Devs... feedback
Overall very well done and I didn't see any technical errors in my read through.
Just a couple of things that I would point out...
for..in loop for an array in JS is possible but will likely provide unexpected results and should probably be avoided in favor of a traditional for loop
http://stackoverflow.com/questions/5263847/javascript-difference-between-for-in-and-for
http://stackoverflow.com/questions/500504/javascript-for-in-with-arrays
@bendalton
bendalton / JSONInterceptor.cfc
Created August 1, 2011 15:57
ColdBox JSON Interceptor to support json http requests
/**
* handles application/json content type requests
*/
component {
void function configure(){}
void function preProcess(event,struct interceptData){
var rc = event.getCollection();
if(isJSONRequest())
@bendalton
bendalton / killChromeFlash
Created January 25, 2011 17:14
quick shell script for getting rid of Chrome's Built-in Flash player so you can use the Debug version
#!/bin/bash
find /Applications/Google\ Chrome.app/Contents/Versions -name Flash\ Player\ Plugin\ for\ Chrome.plugin -ok sudo rm -rf '{}' \;
[root@daltonconsulting rideamigos.com]# pear upgrade-all
PHP Warning: PHP Startup: fileinfo: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
Will upgrade archive_tar
Will upgrade console_getopt
Will upgrade log
Will upgrade pear
<?php
// Block to display field_right_sidebar
if(arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
print(content_format('field_right_sidebar', $node->field_right_sidebar[0], 'default', $node));
}?>
Apr 30, 2009 12:48:25 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/MessageBoard-0.1]
Apr 30, 2009 12:48:25 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive MessageBoard-0.1.war
Apr 30, 2009 12:48:30 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Apr 30, 2009 12:48:30 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/MessageBoard-0.1] startup failed due to previous errors
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.