Skip to content

Instantly share code, notes, and snippets.

@cacheleocode
cacheleocode / Quash_Unquash.txt
Created August 21, 2012 23:34
Quash/Unquash for Eclipse
http://www.eclipse.org/
Quash (only lines with the velocity code)
Find: ^(\s+)([\$|#])
Replace: #*$1*#$2
Un-quash
Find: ^#\*(\s+)\*#
Replace: $1
-----------
Replace empty lines with ## (multiple lines will be replaced into one
@cacheleocode
cacheleocode / list.html
Created August 22, 2012 17:13
jQuery AJAX reading data from SharePoint 2010 list
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>list</title>
<script type="text/javascript" src="/scripts/jquery.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
@cacheleocode
cacheleocode / metadata.js
Created November 8, 2012 00:08
metadata via JS
ie: !!navigator.userAgent.match(/MSIE/),
protocol: location.protocol.match(/https/i) ? 'https' : 'http',
@cacheleocode
cacheleocode / fade.js
Created November 27, 2012 01:21
fade in one after another
$(document).ready(function(){
$("div#foo").fadeIn("fast",function(){
$("div#bar").fadeIn("fast", function(){
// etc.
});
});
$('#quotes img:first-child').fadeIn(2000,function(){
$('#quotes img:last-child').fadeIn(2000,function(){
@cacheleocode
cacheleocode / arrays.php
Created November 27, 2012 01:22
array of arrays accessed randomly
<?php
$arrangements = array(
array(1,2),
array(1,3),
array(2,3),
array(3,1),
array(3,2)
);
@cacheleocode
cacheleocode / iba_widget.css
Created May 3, 2013 01:11
stop the defaults!
#item
{
-webkit-user-select: none;
}
@cacheleocode
cacheleocode / iba_widget.html
Last active December 16, 2015 22:20
stop the defaults!
<!-- different methods -->
<meta name="viewport" content="user-scalable=0"/>
<meta name="viewport" content="width=device-width; initial-scale=.5; maximum-scale=1.0;" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
@cacheleocode
cacheleocode / iba_widget.html
Last active December 16, 2015 23:09
stop the defaults!
<style type="text/css">
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
}
</style>
@cacheleocode
cacheleocode / iba_widget_clean.html
Last active December 16, 2015 23:09
Adobe Edge Animate iBooks Author HTML Widget prevent defaults
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>Untitled</title>
<script>
document.addEventListener('touchstart', function (e) {e.preventDefault();}, false);
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>Untitled</title>
<style type="text/css">
*
{