Skip to content

Instantly share code, notes, and snippets.

@krizpoon
krizpoon / jQueryUtils.js
Last active August 29, 2015 14:07
jQuery utils
_
@krizpoon
krizpoon / TSUrlRelay.php
Created October 8, 2014 07:33
Getting content from URL through a PHP proxy
<?php
function val($array, $key)
{
if (!$array) return null;
if (!isset($array[$key])) return null;
return $array[$key];
}
@krizpoon
krizpoon / TSCreatePlugin.js
Last active April 15, 2020 10:34
jQuery Plugin
/*
Make a jQuery plugin
@param string name - Name of plugin
@param string extend - Name of parent plugin to extend
@param function onInit(element, instance) - a function that initialize the plugin instance on the element. To export methods, assign the functions to the instance.
@param object defaults - a set of default values which can be accessed through instance.options
Example:
@krizpoon
krizpoon / TSDataUtils.js
Last active August 29, 2015 14:07
Javascript Data Utilities
_
@krizpoon
krizpoon / TSStringUtils.js
Last active August 29, 2015 14:07
Javascript String Utilities
String.prototype.getFileExtension = function()
{
var ret = (/[.]/.exec(this)) ? /[^.]+$/.exec(this) : undefined;
if (ret && ret.length) ret = ret[0];
return ret;
}
if (typeof String.prototype.startsWith != 'function')
{
@krizpoon
krizpoon / TSUtils.php
Last active August 29, 2015 14:07
PHP snippets
_
@krizpoon
krizpoon / TSWebCommons.html
Last active August 29, 2015 14:07 — forked from jookyboi/javascript_resources.md
Common Javascript / HTML snippets
_