Skip to content

Instantly share code, notes, and snippets.

@kentliau
kentliau / window.spammer
Created April 15, 2013 06:00
Span a window to stretch your computer
function openWindow(){
var x = Math.floor(Math.random()*1600);
var y = Math.floor(Math.random()*800);
var px = Math.floor(Math.random()*1600);
var py = Math.floor(Math.random()*800);
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {
@kentliau
kentliau / Gruntfile.js
Created February 4, 2014 03:25 — forked from markgoodyear/01-gulpfile.js
Gulpfile and Gruntfile sample
/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass
@kentliau
kentliau / .jshintrc.js
Created February 4, 2014 04:20 — forked from connor/.jshintrc.js
jshintrc file example
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@kentliau
kentliau / gulpfile.js
Last active August 1, 2016 07:48
Gulpfile configuration for Laravel
var //source path
src_scripts = 'public/assets_src/js/*.js',
src_styles = 'public/assets_src/less/**/app.less',
src_images = 'public/assets_src/img/**/*',
src_template = 'app/views/partial/**/*.dot',
//watch path
watch_scripts = 'public/assets_src/js/**/*.js',
watch_styles = 'public/assets_src/less/**/*.less',
watch_images = 'public/assets_src/img/**/*',
@kentliau
kentliau / disable_console.js
Created February 17, 2014 13:21
Disable webkit browser execute script in console
(function(){
var css = "text-shadow: -1px -1px hsl(0,100%,50%), 1px 1px hsl(5.4, 100%, 50%), 3px 2px hsl(10.8, 100%, 50%), 5px 3px hsl(16.2, 100%, 50%), 7px 4px hsl(21.6, 100%, 50%), 9px 5px hsl(27, 100%, 50%), 11px 6px hsl(32.4, 100%, 50%), 13px 7px hsl(37.8, 100%, 50%), 14px 8px hsl(43.2, 100%, 50%), 16px 9px hsl(48.6, 100%, 50%), 18px 10px hsl(54, 100%, 50%), 20px 11px hsl(59.4, 100%, 50%), 22px 12px hsl(64.8, 100%, 50%), 23px 13px hsl(70.2, 100%, 50%), 25px 14px hsl(75.6, 100%, 50%), 27px 15px hsl(81, 100%, 50%), 28px 16px hsl(86.4, 100%, 50%), 30px 17px hsl(91.8, 100%, 50%), 32px 18px hsl(97.2, 100%, 50%), 33px 19px hsl(102.6, 100%, 50%), 35px 20px hsl(108, 100%, 50%), 36px 21px hsl(113.4, 100%, 50%), 38px 22px hsl(118.8, 100%, 50%), 39px 23px hsl(124.2, 100%, 50%), 41px 24px hsl(129.6, 100%, 50%), 42px 25px hsl(135, 100%, 50%), 43px 26px hsl(140.4, 100%, 50%), 45px 27px hsl(145.8, 100%, 50%), 46px 28px hsl(151.2, 100%, 50%), 47px 29px hsl(156.6, 100%, 50%), 48px 30px hsl(162, 100%, 50%), 49px 31px h
@kentliau
kentliau / colors.less
Created February 22, 2014 07:49
Flat UI Colors Less Snippet
//teal
@turquoise: #1abc9c;
@green-sea: #16a085;
//green
@emerald: #2ecc71;
@nephritis: #27ae60;
//blue
@peter-river: #3498db;
@kentliau
kentliau / jquery.selectText.js
Last active August 29, 2015 14:01
Select text with Vanilla and jQuery
// jQuery highlight text plugins
// It will select the text of first occurence
// of jQuery collection of element
jQuery.fn.selectText = function(){
var doc = document
, element = this[0]
, range, selection
;
if (doc.body.createTextRange) {
range = document.body.createTextRange();
@kentliau
kentliau / map.geojson
Last active August 29, 2015 14:02 — forked from arfon/map.geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kentliau
kentliau / JSONView.css
Last active July 6, 2019 21:31
JSONView dark theme (Google Chrome Extension)
body {
white-space: pre;
font-family: 'Ubuntu Mono';
font-size: 16px;
line-height:20px;
color: white;
background-color: #2B2A27;
}
.property {