Skip to content

Instantly share code, notes, and snippets.

On the psychology of freemium:
- Why do teens spend real money in virtual worlds? A consumption values and developmental psychology perspective on virtual consumption
http://www.sciencedirect.com/science/article/pii/S0268401214001030
- What Is a Variable-Ratio Schedule?
http://psychology.about.com/od/vindex/g/def_variablerat.htm
- The Psychology of “Freemium”
http://www.psychguides.com/interact/the-psychology-of-freemium/
update db.coll query: { _id: ObjectId('xxxxxxxxxxxxxxxxxxxxxxxxxxx') } update: { $set: { updated_at: new Date(1395845839340) } }
marcot@Marcos-MacBook-Pro-2 ~/S/n/osmos (develop)> npm publish
npm http PUT https://registry.npmjs.org/osmos-odm
npm http 409 https://registry.npmjs.org/osmos-odm
npm http GET https://registry.npmjs.org/osmos-odm
npm http 200 https://registry.npmjs.org/osmos-odm
npm http PUT https://registry.npmjs.org/osmos-odm/-/osmos-odm-1.2.11.tgz/-rev/69-e1bc060fb1d8f9f1a2d9aea184e97370
npm http 500 https://registry.npmjs.org/osmos-odm/-/osmos-odm-1.2.11.tgz/-rev/69-e1bc060fb1d8f9f1a2d9aea184e97370
npm ERR! registry error parsing json
-(void)drawRect:(CGRect)rect {
CGFloat side = MIN(self.bounds.size.width, self.bounds.size.height);
NSInteger steps = 512;
float internalRadius = side * 0.0;
float externalRadius = side * 0.5;
float halfinteriorPerim = M_PI * internalRadius;
float halfexteriorPerim = M_PI * externalRadius;
@mtabini
mtabini / gist:3161449
Created July 23, 2012 00:19
I think I have successfully reverse engineered Interface Builder's layout algorithm when moving views between containers
- (void) layoutComponents {
// HAHAHHAHAHAHAAHAHAHAHA
}
<div class="swipe">
<img src="img/swipe-annotation.png" height="30" link="bookmark"><img src="img/swipe-favourite.png" height="30" link="favourite"><img src="img/swipe-pencil.png" height="30" link="annotate"><img src="img/swipe-email.png" height="30" link="email"><img src="img/swipe-tweet.png" height="30" link="tweet"><img src="img/swipe-facebook.png" height="30" link="facebook">
</div>
In your JS (assuming you have jQuery, otherwise will need to adjust accordingly):
$(".swipe img[link]").click(function() {
document.location.href = $(this).attr("link") + "://" + $(this).attr("link");
});
@mtabini
mtabini / gist:1197888
Created September 6, 2011 15:38
Catching PHP Warnings
<?php
error_reporting(E_ALL | E_STRICT);
function myHandler($errno, $errstr) {
throw new Exception($errstr, $errno);
}
set_error_handler('myHandler', E_ALL | E_STRICT);
@mtabini
mtabini / gist:1178403
Created August 29, 2011 13:35
PNG representation of NSImage
//
// GRAppDelegate.m
// Testme
//
// Created by Marco Tabini on 11-08-29.
// Copyright (c) 2011 Marco Tabini. All rights reserved.
//
#import "GRAppDelegate.h"
@mtabini
mtabini / Shorten URL.scpt
Created April 30, 2011 19:04
Applescript script for shortening a URL
-- URLEncode routing from http://harvey.nu/applescript_url_encode_routine.html
on urlencode(theText)
set theTextEnc to ""
repeat with eachChar in characters of theText
set useChar to eachChar
set eachCharNum to ASCII number of eachChar
if eachCharNum = 32 then
set useChar to "+"
else if (eachCharNum ≠ 42) and (eachCharNum ≠ 95) and (eachCharNum < 45 or eachCharNum > 46) and (eachCharNum < 48 or eachCharNum > 57) and (eachCharNum < 65 or eachCharNum > 90) and (eachCharNum < 97 or eachCharNum > 122) then
@mtabini
mtabini / gist:900935
Created April 3, 2011 23:46
Marco's Bolognese recipe

Marco's Bolognese recipe

  • 300g ground skirt steak
  • 100g pancetta
  • 1/2 onion
  • 1/2 carrot
  • 1 celery stalk
  • 1/2 cup dry white wine
  • 1 cup milk
  • 1/2 cup tomato paste