Skip to content

Instantly share code, notes, and snippets.

View radius's full-sized avatar

darius daftary radius

View GitHub Profile
@radius
radius / inputPlaceholder.jquery.js
Created May 16, 2012 15:30
Input Placeholder jQuery Plugin
$.fn.inputPlaceholder = function(options){
return $(this).each(function() {
var options = jQuery.extend({
text: $(this).attr('placeholder')
},options);
if($(this).val() == '') {
$(this).val(options.text);
}
$(this)
@radius
radius / Logger.js
Created February 10, 2012 02:08
Little JS logger class
var Logger = (function() {
return {
active: true,
post: false,
log: function(obj, type) {
if(Logger.active) {
console.log(obj);
}
if(Logger.post) {
$.post(Logger.post, {
@radius
radius / gist:9102288
Created February 19, 2014 21:42
AngularJS module for executing an expression when an element is shown
angular.module('OnShow', []).
directive('onShow', function () {
return {
controller: function($scope) {
$scope.fireOnce = false;
this.setFireOnce = function(bool) {
$scope.fireOnce = bool;
}
},
link: function(scope, elm, attr) {