Skip to content

Instantly share code, notes, and snippets.

Sebastian Markbåge sebmarkbage

Block or report user

Report or block sebmarkbage

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cat.js
// EXAMPLE: a compound iterator with sequencing
// Python style
function cat() {
let is = arguments;
return {
next: {
let length;
while ((length = is.length) > 0) {
try {
View MooTools-Tests.html
<html>
<head>
<script src="mootools.js"></script>
<script src="mootools-1.2.4.4-more.js"></script>
<script src="rx.js"></script>
<script src="rx.mootools.js"></script>
<script>
window.addEvent('domready', function() {
View Array.Shuffle.js
// Array shuffle for MooTools
Array.implement({
shuffle: function(){
for (var i = this.length; i && --i;){
var temp = this[i], r = Math.floor(Math.random() * ( i + 1 ));
this[i] = this[r];
this[r] = temp;
}
View MyLocalArrayCopy.js
PRELOADING REQUIRED:
Sheer({
original: 'urn:Sheer:Lang:Array',
require: {
'urn:Sheer:Lang': ['Type', 'Object', 'Function']
}
}, function(Type, Object, Function) {
View animation.js
/*=
name: Animation
description: Simple animations implementation that work with standard-sized browsers (using Fx) and use webkit css animations where available.
license: MooTools MIT-Style License (http://mootools.net/license.txt)
copyright: Valerio Proietti (http://mad4milk.net)
authors: Valerio Proietti (http://mad4milk.net)
requires: MooTools 1.2.3+ (Core) (http://mootools.net/download)
=*/
var Animation = new Class({
View Element.truncate.js
Element.implement({
/**
truncates element text to fit in element width.
end (bool) defaults false. True = cuts string at end, False = cuts string in middle
str (string) truncation string default : '...'
**/
truncate : function(end,str){
str = str || '...';
var style = this.style;
var originalStyles = { overflow: style.overflow, 'white-space': style.whiteSpace, padding: style.padding };
You can’t perform that action at this time.