This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.support.placeholder = false; | |
var test = document.createElement('input'); | |
if ('placeholder' in test) $.support.placeholder = true; | |
$.fn.placeholderFallback = function () { | |
if (!$.support.placeholder) { | |
var active = document.activeElement; | |
this.focus( | |
function () { | |
if ($(this).attr('placeholder') != '' && $(this).val() == $(this).attr('placeholder')) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.Deferred.timeout = function (duration) { | |
var dfd = $.Deferred(); | |
setTimeout(function () { | |
dfd.resolve(); | |
}, duration); | |
return dfd.promise(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var imageUrl = 'url("my-image.jpg")'.replace(/^url\(["']?/, '').replace(/["']?\)$/, ''); | |
alert(imageUrl); | |
// returns "my-image.jpg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Element.addMethods(["textarea"], { | |
/** | |
* @description supports maxLength-limitations to textarea; | |
* @param element | |
* @param max charset length in field | |
* @param handler a handler-function which have the current left charset value in parameter | |
*/ | |
maxTextLength: function(element, max, handler){ | |
element = $(element); | |
handler = (handler == undefined) ? function(){} : handler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach(glob("*.html") as $page){ | |
echo '<li><a href="' . $page . '">' . $page . '</a></li>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// names and colors from http://flatuicolors.com/ | |
$turquoise: #1ABC9C; | |
$green-sea: #16A085; | |
$emerland: #2ECC71; | |
$nephritis: #27AE60; | |
$peter-river: #3498DB; | |
$belize-hole: #2980B9; | |
$amethyst: #9B59B6; | |
$wisteria: #8E44AD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="tilesCollection"> | |
<div class="tiles" id="t1">A</div> | |
<div class="tiles" id="t2">B</div> | |
<div class="tiles" id="t3">C</div> | |
<div class="tiles" id="t4">D</div> | |
<div class="tiles" id="t5">E</div> | |
<div class="tiles" id="t6">F</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// install gulp depencies | |
// npm install -D gulp gulp-ruby-sass gulp-autoprefixer gulp-connect gulp-connect gulp-rename gulp-minify-css gulp-filesize gulp-filter gulp-base64 gulp-notify | |
// Set source and destination directory | |
var config = { | |
src: './app/scss/**/*.scss', | |
dest: './app/css' | |
} | |
// watch with gulp css:watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var faker = require('faker'); | |
var Chance = require('chance'); | |
var fs = require('fs'); | |
var chance = new Chance(); | |
var max = 28; | |
var participants = []; | |
var i = 0; | |
for (i; i < max; i++) { |
OlderNewer