Skip to content

Instantly share code, notes, and snippets.

View commadelimited's full-sized avatar
😄

Andy Matthews commadelimited

😄
View GitHub Profile
@commadelimited
commadelimited / 2011-02-13-02.css
Created January 19, 2012 20:43
Creating and using custom icons
.ui-icon-myapp-settings {
background: url("settings.png") no-repeat rgba(0, 0, 0, 0.4) !important;
}
@commadelimited
commadelimited / 2011-02-13-03.css
Created January 19, 2012 20:44
Creating and using custom icons
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
// declarations go here
}
@commadelimited
commadelimited / 2011-02-13-04.css
Created January 19, 2012 20:44
Creating and using custom icons
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
.ui-icon-myapp-settings {
background: url("[email protected]") no-repeat rgba(0, 0, 0, 0.4) !important;
background-size: 18px 18px;
}
// more declarations here
}
@commadelimited
commadelimited / 2011-02-08-01.html
Created January 19, 2012 20:46
Introduction to jQuery-Mobile
<!DOCTYPE html>
<html>
<head>
<title>Intro to jQuery Mobile</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
</head>
<body>
<div data-role="page" id="intro">
@commadelimited
commadelimited / 2011-02-01-01.cfm
Created January 19, 2012 20:51
Pure CFScript CFCs
<cfcomponent output="false" displayname="Tag Based CFC" name="userBean">
<cfset VARIABLES.username = '>
<cfset VARIABLES.password = '>
<cffunction name="init" returntype="userBean" access="public">
<cfargument name="username" required="true" type="string">
<cfargument name="password" required="true" type="string">
<cfset VARIABLES.username = ARGUMENTS.username>
<cfset VARIABLES.password = ARGUMENTS.password>
</cffunction>
<cffunction name="getUsername" returntype="string" access="public">
@commadelimited
commadelimited / 2011-02-01-02.cfm
Created January 19, 2012 20:52
Pure CFScript CFCs
<cfcomponent output="false" accessors="true" displayname="Tag Based CFC" name="userBean">
<cfproperty name="username" />
<cfproperty name="password" />
<cffunction name="init" returntype="userBean" access="public">
<cfargument name="username" required="true" type="string">
<cfargument name="password" required="true" type="string">
<cfset setUsername( ARGUMENTS.username ) />
<cfset setPassword( ARGUMENTS.password ) />
<cfreturn this />
</cffunction>
@commadelimited
commadelimited / 2011-02-01-02.cfc
Created January 19, 2012 20:53
Pure CFScript CFCs
component {
property string username;
property string password;
public tagCFC function init(required string username, required string password) {
setUsername(ARGUMENTS.username);
setPassword(ARGUMENTS.password);
return this;
}
}
@commadelimited
commadelimited / 2011-02-01-04.cfm
Created January 19, 2012 20:53
Pure CFScript CFCs
<cfscript>
VARIABLES.user = new User(username='thumbelina', password='longhair');
VARIALBES.getUserName() // returns thumbelina
VARIABLES.setPassword('abc123') // sets password
</cfscript>
@commadelimited
commadelimited / 2011-01-17-01.js
Created January 19, 2012 20:56
Morse Code Generator
var morse = {
a: '.-', b: '-...', c: '-.-.', d: '-..',
e: '.', f: '..-.', g: '--.', h: '....',
i: '..', j: '.---', k: '-.-', l: '.-..',
m: '--', n: '-.', o: '---', p: '.--.',
q: '--.-', r: '.-.', s: '...', t: '-',
u: '..-', v: '...-', w: '.--', x: '-..-',
y: '-.--', z: '--..', 0: '-----', 1: '.----',
2: '..---', 3: '...--', 4: '....-', 5: '.....',
6: '-....', 7: '--...', 8: '---..', 9: '----.'
@commadelimited
commadelimited / 2011-01-17-02.js
Created January 19, 2012 20:57
Morse Code Generator
//preload the sounds
var snd = {};
var shortClip = air.File.applicationDirectory.resolvePath("assets/short.mp3");
var longClip = air.File.applicationDirectory.resolvePath("assets/long.mp3");
snd['.'] = new air.Sound(new air.URLRequest(shortClip.url));
snd['-'] = new air.Sound(new air.URLRequest(longClip.url));