This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function im_stoned(data, callback) { | |
data = data+1; | |
callback.call({"data": data}); | |
} | |
im_stoned(4, function() { | |
alert(this.data); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Slideshow = function () { | |
var _public = { | |
init : function () { | |
images = $('div.slideshow ul li a'); | |
State.curimage = $(images[0]).attr('href'); | |
$('div.slideshow ul li a').click(Events.click); | |
if ( images.length > 1 ) { | |
cycle(1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="slideshow"> | |
<div class="viewer-1" style="display: block;"><img src="/sites/Acumen/uploads/rad3-large_2.jpg"></div> | |
<div class="viewer-0"><img src="/sites/Acumen/uploads/rad2-large_3.jpg"></div> | |
<ul> | |
<li class="first"> | |
<a href="/sites/Acumen/uploads/rad1-large_2.jpg"> | |
<img src="/sites/Acumen/uploads/tn_rad1-large_2.jpg"> | |
</a> | |
</li> | |
<li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timer; | |
var sections = [] // array of sections, could just be a jQuery selector | |
var i = 0; | |
var cycle = function (sections, i) { | |
if (i < sections.length) { | |
timer = setTimeout(function () { | |
//animate section | |
cycle(i+=1, sections) | |
}, 3000) | |
} else { // start again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
overflow: auto; | |
} | |
body { | |
position: absolute; | |
top: 0; | |
left: 0; | |
bottom: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawVisualization() { | |
// Create and populate the data table. | |
var data = new google.visualization.DataTable(); | |
data.addColumn('string', 'Year'); | |
data.addColumn('number', 'Sales'); | |
data.addColumn('number', 'Expenses'); | |
data.addRows(11); | |
data.setValue(0, 0, '0'); | |
data.setValue(0, 1, 1000); | |
data.setValue(0, 2, 400); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MBP:nodetest ollie$ node --version | |
0.1.94 | |
MBP:nodetest ollie$ node app.js | |
Error: Uncaught, unspecified 'error' event. | |
at Object.emit (events:13:15) | |
at Object.get (/Users/ollie/Code/nodetest/lib/mongoose/lib/model/index.js:195:53) | |
at Object.get (/Users/ollie/Code/nodetest/lib/mongoose/mongoose.js:107:29) | |
at Object.static (/Users/ollie/Code/nodetest/lib/mongoose/lib/storage.js:81:32) | |
at Object.<anonymous> (/Users/ollie/Code/nodetest/models/imageprovider.js:6:13) | |
at Module._compile (module:385:23) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.slugify = function () { | |
return this.replace(/\s/g,'-').replace(/[^a-zA-Z0-9\-]/g,'').replace(/[\-]+/g,'-').replace(/\-$/,'').replace(/^\-/,'').toLowerCase(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin, subprocess, os | |
class CompileLessOnSave(sublime_plugin.EventListener): | |
def on_post_save(self, view): | |
if not view.file_name().endswith('.less'): | |
return | |
if os.name == "nt": | |
startupinfo = subprocess.STARTUPINFO() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#font { | |
@helvetica-stack: "Helvetica Neue", Arial, sans-serif; | |
@helvetica-heavy-stack: @helvetica-stack; | |
@helvetica-light-stack: "HelveticaNeueW01-Thin", @helvetica-stack; | |
@helvetica-italic-stack: "HelveticaNeue-Italic", @helvetica-stack; | |
// sizes | |
@base-font-size: 14px; | |
.big() { | |
font-size: 4 * @base-font-size; |
OlderNewer