This is now an actual repo:
This file contains hidden or 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
ProgressOn("Progress Meter", "Increments every second", "0 percent") | |
For $i = 10 to 100 step 10 | |
sleep(1000) | |
ProgressSet( $i, $i & " percent") | |
Next | |
ProgressSet(100 , "Done", "Complete") | |
sleep(500) | |
ProgressOff() |
This file contains hidden or 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
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** | |
#AutoIt3Wrapper_Icon=..\Users\ddhahn\Downloads\scb.ico | |
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker | |
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** | |
;Kill Outlooks script | |
$pid = processexists("outlook.exe") | |
while $pid <> 0 | |
MsgBox(1,"Outlook Killed","Outlook.exe (" & $pid & ") has been killed") |
This file contains hidden or 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
// Cross browser, backward compatible solution | |
(function( window, Date ) { | |
// feature testing | |
var raf = window.mozRequestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.msRequestAnimationFrame || | |
window.oRequestAnimationFrame; | |
window.animLoop = function( render, element ) { | |
var running, lastFrame = +new Date; |
Every time I start a node module, or a new JS project, I'm confronted with this same question: how do I structure it to allow it to be used in the browser or nodejs, without requiring a build step, and without getting in the way of my development?
While developing, I typically create some type of [browser-based environment][]; Firebug and Web Inspector are still miles ahead of anything else we've got. Ideally I want to be able to add a file via a script
tag, and have that be the only requirement.
As @visionmedia [points out][], this is [ridiculous][].
This gist is meant to compile all of the various ways I've seen of guarding against/for a variety of module systems. Fork it and add your own, I'll try to bring them into this one.
This file contains hidden or 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 s = new Signal(), cb = function(a, b){ console.log('callback', arguments, this); }; | |
s.add(cb); | |
s.add(cb); | |
s.dispatch('for', 'science', '!', 1); | |
s.remove(cb); | |
s.dispatch('for', 'science', '!', 2); | |
s.remove(cb); | |
s.dispatch('for', 'science', '!', 3); |
This file contains hidden or 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
// This is a comparison between Haskell and Groovy based on some simple problems found in the following | |
// Haskell Introduction: | |
// http://learnyouahaskell.com/starting-out#ready-set-go | |
// Ex 1. If we have two lists, [2,5,10] and [8,10,11] and we want to get the products of all the possible | |
// combinations between numbers in those lists, here's what we'd do. | |
/* HASKELL */ | |
[ x*y | x <- [2,5,10], y <- [8,10,11]] |
This file contains hidden or 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
// No commas | |
def a = 'tim' | |
def nocom = match( a ) { | |
when 'dave' 'Hi Dave' | |
when 'tim' 'Hi Tim' | |
otherwise 'none of the above' | |
} | |
assert nocom == 'Hi Tim' | |
// Commas |
This file contains hidden or 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
/** | |
* Copyright (C) 2011 Yusuke Yamamoto | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* | |
**/ | |
@Grab(group='quartz', module='quartz', version='1.5.2') | |
@Grab(group='org.twitter4j', module='twitter4j-core', version='2.2.5') |
This file contains hidden or 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
/* | |
Check if all images are loaded | |
- Callback occurs when all images are loaded | |
- image load errors are ignored (complete will be true) | |
- Use: | |
$('.wrap img').imagesLoaded(function(){ | |
alert('all images loaded'); | |
}); | |
*/ |