Skip to content

Instantly share code, notes, and snippets.

View qawemlilo's full-sized avatar

Qawelesizwe Mlilo qawemlilo

View GitHub Profile
@qawemlilo
qawemlilo / slideshow.js
Created October 4, 2010 11:53
A simple slide show
/*
Author: Qawelesizwe Mlilo
Email: qawemlilo@gmail.com
Dependency: Mootools
Notes: This code was used in a Joomla! project and can be easily modified to run without a library
*/
var slideShow = function (img, o) {
this.element = $(img);
var oldPreload = {
myImages: [], // stores image url paths
counter: 0, // keeps count of all loaded images
intervalId: null, // keeps setInterval pointer id
imageFolder: [], // stores images objects
@qawemlilo
qawemlilo / newPreload.js
Created January 27, 2011 14:26
Image preloading object(Class)
/*
****************************************************
COPYRIGHT © 2011 Raging Flame
AUTHOR: Qawelesizwe Mlilo
****************************************************
*/
var imgPreload = {
@qawemlilo
qawemlilo / utility.js
Created February 14, 2011 07:39
Load optimisation
/*
Author: Qawelesizwe Mlilo
Email: qawemlilo@gmail.com
Notes: This script is for optimising loading speed for pages with many images.
*/
// Mootools
window.addEvent('domready', function () {
$$("img").each(function (image) {
@qawemlilo
qawemlilo / view_bookmarks.js
Created April 11, 2011 12:14
A hacker's bookmarks
/*
****************************************************
COPYRIGHT © 2011 Raging Flame
AUTHOR: Qawelesizwe Mlilo
Email: qawemlilo@gmail.com
****************************************************
*/
(function (g_url) {
@qawemlilo
qawemlilo / add_bookmark.js
Created April 11, 2011 12:38
A hacker's bookmarks
/*
****************************************************
COPYRIGHT © 2011 Raging Flame
AUTHOR: Qawelesizwe Mlilo
Email: qawemlilo@gmail.com
****************************************************
*/
function saveBookmark(data){
var requester = false;
@qawemlilo
qawemlilo / LICENSE.txt
Created May 24, 2011 09:59 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@qawemlilo
qawemlilo / createuser.php
Created May 26, 2011 11:36
Joomla 1.6 Create new user Class - also creates a folder associated with user.
<?php
/*
****************************************************
COPYRIGHT © 2011 Raging Flame
AUTHOR: Qawelesizwe Mlilo
Email: qawemlilo@gmail.com
****************************************************
*/
class createUser {
function toGreyScale(r, g, b) {
return r * 0.2989 + g * 0.5870 + b * 0.1140;
}
function editImage(img, targetDiv) {
var id = "editeImage", canvasContainer = document.getElementById(targetDiv),
imgCanvas, ctx, imageData, px, len, i, redPx, greenPx, bluePx, greyscale;
imgCanvas = document.createElement("canvas");
imgCanvas.id = id;
@qawemlilo
qawemlilo / grayscale.js
Created July 19, 2011 09:20
Edit images to grayscale using JavaScipt and HTML5 canvas.
function toGreyScale(r, g, b) {
return r * 0.2989 + g * 0.5870 + b * 0.1140;
}
function editImage(img, targetDiv) {
var id = "editeImage", canvasContainer = document.getElementById(targetDiv),
imgCanvas, ctx, imageData, px, len, i, redPx, greenPx, bluePx, greyscale;
imgCanvas = document.createElement("canvas");
imgCanvas.id = id;