Skip to content

Instantly share code, notes, and snippets.

View swannodette's full-sized avatar

David Nolen swannodette

View GitHub Profile
var Slider=new Class({
Implements:Chain,
initialize: function (element){
this.element = $(element);
},
slide: function(prop, pos0, pos1){
this.element.set('tween', {
duration : 2000,
transition : Fx.Transitions.Cubic.easeInOut
});
@swannodette
swannodette / gist:13673
Created September 29, 2008 20:56
Rodrigo's code
var MySliderClass = new Class({
Implements: Chain,
initialize: function (element)
{
this.element = $(element);
},
prepareSlide: function(prop, pos0, pos1)
<?
$hello = "this is better";
function foo()
{
echo "bar";
}
?>
// this is a space instance or shift instance
this.xmlhttpRequest({
'method': 'GET',
'url':'http://someurl.com',
'onload': function(response)
{
// callback code, response arg is the response text
},
'onerror': function(response)
{
$(cssId).set('tween', {
duration: 300,
transition: Fx.Transitions.Cubic.easeInOut
onStart: function()
{
// before animation starts
// you can set up your element here
},
onComplete: function()
{
initResizer: function()
{
// place the resizer above the thing
var resizer = new ShiftSpace.Element('div', {
'id': 'SSConsoleResizer'
});
document.body.grab(resizer);
// added a comment
{
action: 'create/read/update/delete',
table: 'user/shift/trail/comment',
constraints: {
user_id: 67
},
properties: '*' || ['username', 'summary', 'modified'],
orderby: ['<' || '>', 'modified'],
startIndex: 2,
count: 20
{
table: 'shifts',
create: 'all',
update: ['shift.user_id == $loggedin_user'],
delete: ['shift.user_id == $loggedin_user'],
read: ['shift.private && shift.user_id == $loggedin_user',
'shift.group == $loggedin_user.group'],
presentation: [
'someproperty',
'someproperty2',
var FxChain = new Class({
name: "FxChain",
Extends: Chain,
initialize: function()
{
this.chain(arguments);
},
(defn diffuse [grid diff-ratio dt]
(let [a (float (* dt diff-ratio grid-size grid-size))
a4-1 (float (+ 1 (* 4 a)))
grid #^floats (deref grid)
diffused-grid #^floats (make-grid)
grid-size (int grid-size)
line-length (int (+ grid-size 2))]
(dotimes [n 20]
(dotimes [y grid-size]
(let [line-offset (* (inc y) line-length)]