Skip to content

Instantly share code, notes, and snippets.

@lsmith
lsmith / gist:9868174
Last active August 29, 2015 13:57 — forked from jshirley/gist:9863326

Leveraging Technology to Increase Pain of Paying, and Improve Personal Savings

As technology advances, p_P_eople are getting further from the hard concept of money. Without seeing immediate feedback, people repeat undesiredby whom? behaviors without having any painbetter word?. The tendency to repeat previous behaviors without thinking of the original motivation has been observed (Ariely, D. & Norton, M. I., 2008)footnote?. This behavior may cause repeatedmay increase purchases without adequatewith inadequate? deliberate decision-makingdeliberation?.

This problem is exacerbated by the reduction of the pain of paying as the distance from physical currency increases (Ariely and Silva, 2002). We are increasingly moving towards electronic payments and this trend will not reverse (Borzekowski, Kiser, Ahmed, 2006).Isn't this correlating physical proximity with conceptual proximity?

onDataReturnInitializeTable : function(sRequest, oResponse, oPayload) {
if((this instanceof DT) && this._sId) {
this.initializeTable();
this.onDataReturnSetRows(sRequest,oResponse,oPayload);
}
}
function format_number(n,prec,dec,sep) {
// Original by Luke Smith (http://lucassmith.name)
n = !isFinite(+n) ? 0 : +n;
prec = !isFinite(+prec) ? 2 : Math.abs(prec);
sep = sep == undefined ? ',' : sep;
var s = n.toFixed(prec),
abs = Math.abs(n).toFixed(prec),
_, i;
@lsmith
lsmith / typeof.js
Created January 16, 2009 16:53
JavaScript function to serve as a replacement for native typeof that returns more useful values. Example usage page at http://lucassmith.name/pub/typeof.html
var _toS = Object.prototype.toString,
_types = {
'undefined' : 'undefined',
'number' : 'number',
'boolean' : 'boolean',
'string' : 'string',
'[object Function]' : 'function',
'[object RegExp]' : 'regexp',
'[object Array]' : 'array',
'[object Date]' : 'date',
// Use case:
var myDataTable = new YAHOO.widget.DataTable(id,cols,source,{
paginator : YAHOO.foo.createPaginator({ containers : "bar" })
});
// Method definition
YAHOO.namespace('foo').createPaginator = function (cfg) {
return new YAHOO.widget.Paginator(
// Merge configuration from cfg into some defaults
YAHOO.lang.merge({
/**
* Takes a native JavaScript Number and formats to string for display to user.
*
* @method format
* @param nData {Number} Number.
* @param oConfig {Object} (Optional) Optional configuration values:
* <dl>
* <dt>prefix {String}</dd>
* <dd>String prepended before each number, like a currency designator "$"</dd>
* <dt>decimalPlaces {Number}</dd>
YAHOO.widget.Slider.prototype.setStartSliderState = function() {
this.logger.log("Fixing state");
this.setThumbCenterPoint();
this.baselinePos = getXY(this.getEl());
this.thumb.startOffset = this.thumb.getOffsetFromParent(this.baselinePos);
// Declare the DS config during construction. Also leverage the inline override
// support to replace the DS native setInterval implementation with a custom function
// that takes a function ref to generate the url sent
var ds = new YAHOO.util.DataSource(url, {
responseType : YAHOO.util.DataSource.TYPE_JSON,
responseSchema : {
resultsList : 'Results',
fields : [ 'foo','bar','baz' ],
},
setInterval : unction(ms, reqBuilder, callback) {
function formatNumber(n) {
if (!isFinite(n)) {
return n;
}
var s = ""+n, abs = Math.abs(n), _, i;
if (abs >= 1000) {
_ = (""+abs).split(/\./);
i = _[0].length % 3 || 3;
// Converts the content inside <script src="script2style.js">YOUR CSS</script>
// into a style block that will only be applied if js is turned on
(function () {
var d = document,
scripts = d.getElementsByTagName('script'),
me = scripts[scripts.length - 1],
head = d.getElementsByTagName('head')[0],
content = me.innerHTML.replace(/@import\((.*?)\);?/m,function (m,href) {