Skip to content

Instantly share code, notes, and snippets.

@Prottoy2938
Prottoy2938 / rgba-to-css-filter.js
Last active July 28, 2025 05:32
RGBA To CSS Filter Converter. This code is a slightly modified version of this stackoverflow answer: https://stackoverflow.com/a/43960991/604861
"use strict";
class Color {
constructor(r, g, b) {
this.set(r, g, b);
}
toString() {
return `rgb(${Math.round(this.r)}, ${Math.round(this.g)}, ${Math.round(
this.b
)})`;
// iMacro CheatSheet - Command Reference
// http://wiki.imacros.net/Command_Reference
// iMacros supports 3 types of variables:
// * The macro variables !VAR0 thru !VAR9. They can be used with the SET and ADD command inside a macro.
// * Built-in variables. They contain certain values set by iMacros.
// * User-defined variables. They are defined in-macro using the SET command.
@optikalefx
optikalefx / chat.html
Created June 4, 2013 16:36
RealTime + Root.js
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="realtime.js"></script>
<style type="text/css">
#chat {
width:300px;
height:300px;
border:1px solid black;
@optikalefx
optikalefx / Super Simple Ajax File Upload (XHR2).js
Last active February 17, 2026 23:46
Ajax File upload with jQuery and XHR2Sean Clark http://square-bracket.com
// Ajax File upload with jQuery and XHR2
// Sean Clark http://square-bracket.com
// xhr2 file upload
$.fn.upload = function(remote, data, successFn, progressFn) {
// if we dont have post data, move it along
if (typeof data != "object") {
progressFn = successFn;
successFn = data;
}