Skip to content

Instantly share code, notes, and snippets.

@dansimco
dansimco / app.rb
Created May 29, 2012 15:09
Concise Sinatra Amazon S3 Upload Example
require "rubygems"
require 'sinatra'
require "aws/s3"
get '/' do
return %Q{
<form action="upload" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<div>
<input type="file" name="file" value="" id="file">
</div>
@dansimco
dansimco / uploadPhotoToFacebook.js
Created January 2, 2013 04:27
Posts a photo to a users profile, creating a gallery where needed.
/*global FB, alert, console */
//Usage
// uploadPhotoToFacebook({
// caption: 'A Picture',
// url: 'http://lorempixel.com/400/300/',
// album: 'JS API',
// album_description: "An album of pictures",
// onSuccess: function(){
@dansimco
dansimco / gist:3106555
Created July 13, 2012 18:38
InstantFileUploader
/*global Element, IFrame, document, Button */
var InstantFileUploader;
InstantFileUploader = function (input, params) {
"use strict";
var self = this;
self.frameId = String.uniqueID();
self.loading = false;
self.onComplete = params.onComplete || function () {};
@dansimco
dansimco / gist:3067704
Created July 7, 2012 19:08
touchUpInside
isTouchInside = function(e){
var event = e.originalEvent;
touch_inside = false;
if (! event.touches[0] ) return touch_inside;
touchX = event.touches[0].pageX;
touchY = event.touches[0].pageY;
if(
touchX > element_coords.left &&
touchX < element_coords.right &&
touchY > element_coords.top &&
@dansimco
dansimco / SEHGymRules.md
Created May 15, 2012 21:05
Draft for SEH Gym rules poster

##NSE Gym

##PICK UP AFTER YOURSELF

  • Return weight plates, bars and dumbbells to their designated places when not in use.
  • Throw your paper towels and rubbish in the trash.
  • DO NOT leave dumbbells on the floor or weight plates on the bar.
  • If you move equipment, put it back where it belongs (Otherwise the porters are unable to clean the gym effectively).

##NOISE


#HBG

Financially distressed businesses within Australia seeking re-engineering, re-structuring and a strategy to trade out of their existing problem. Businessess seeking support of corporate strategists to grow their business, protect their assets and investigate new areas. Businesses that have grown beyond their resources and want to bring on a specialised level of accounting and business support. High net worth individuals seeking personal advisor and gatekeeper.

##Services

  • Accountancy
@dansimco
dansimco / gist:767668
Created January 6, 2011 08:10
poopevent
btn.addEvent('touchend',function(event){
var touchX = event.event.changedTouches[0].pageX;
var touchY = event.event.changedTouches[0].pageY;
var spotCoords = btn.getCoordinates();
if(touchX>spotCoords.left && touchX<spotCoords.right && touchY>spotCoords.top && touchY<spotCoords.bottom){
alert('TouchUpInside!!!');
} else {
alert('Touch up outside');
}
});
@dansimco
dansimco / Adobe Shortcuts
Created December 13, 2010 05:18
Keyboard Shortcuts for the adobe suits
#Indesign
##Panels
* Layers: F7
* Edit Type: cmd + T
* Color: F6
* Align: Shift + F7
Connection report for process: Safari (/Applications/Safari.app)
Total: 22.3kB sent, 259.2kB received
PID 337:
PID 3691:
ne.wac.edgecastcdn.net (72.21.91.19), Port 80 (http), Protocol 6 (TCP), 372 Bytes sent, 8.3kB received
www.dallasjclark.com (72.47.224.123), Port 80 (http), Protocol 6 (TCP), 19.7kB sent, 239.6kB received
track.reinvigorate.net (64.13.247.191), Port 80 (http), Protocol 6 (TCP), 0.8kB sent, 258 Bytes received
docs.google.com (66.102.11.100), Port 80 (http), Protocol 6 (TCP), 1.3kB sent, 11.1kB received
@dansimco
dansimco / gist:716107
Created November 26, 2010 00:22
button bullshit
button, .button {
.gloss;
border: 1px solid #333;
border-top: 1px solid #444;
border-bottom: 1px solid #222;
.rounded(3px);
width: 50px;
padding: 8px 0px;
float: left;
margin: 0px 5px 0px 0px;