Skip to content

Instantly share code, notes, and snippets.

View alkaruno's full-sized avatar
🏠
Working from home

Alexey Karunos alkaruno

🏠
Working from home
View GitHub Profile
@alkaruno
alkaruno / Base64.js
Created September 9, 2014 14:36
Base64 encode & decode (only for numbers) in JavaScript
var Base64 = (function () {
var ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var Base64 = function () {};
var _encode = function (value) {
if (typeof(value) !== 'number') {
throw 'Value is not number!';
@alkaruno
alkaruno / jquery.disableIfEmpty.js
Created September 4, 2013 05:23
Disable element(s), if field(s) is empty
/**
* Licensed under the MIT license by Alexey Karunos (https://github.com/alkaruno)
*/
(function ($) {
$.fn.disableIfEmpty = function (elementsToObserve) {
var elementToDisable, disableElement;
return this.each(function () {
elementToDisable = $(this);
disableElement = function () {
var hasEmptyField = false;
@alkaruno
alkaruno / widgets.js
Created January 16, 2012 12:16
Widgets Library
/**
* Widgets Library
* @version 0.1
* @author Alexey Karunos (alkaruno@gmail.com)
* @example
* var widgets = new Widgets('http://site.com/widgets/');
* widgets.show('userinfo');
*/
;
function Widgets(urlPrefix, urlSuffix) {