Skip to content

Instantly share code, notes, and snippets.

@jafstar
jafstar / FancyRadioBtn.html
Created January 4, 2012 18:55
Fancy Radio Button
<html>
<head>
<title>Fancy Radio Button</title>
</head>
<body>
<form action='some.php'>
<label for="employed1" >Are you currently employed?</label>
<br />
@jafstar
jafstar / optout.txt
Created January 27, 2012 09:06
People Finder Opt Out
http://www.peoplesmart.com/optout
http://www.peoplefinders.com/optout-form.pdf
http://www.spokeo.com/privacy
https://www.intelius.com/optout.php
@jafstar
jafstar / objects.js
Created January 29, 2012 05:14
Multiplayer Objects - Auto vs Jump
//AUTO
if(player.y >= floor_base - 20 && player.x <= 2680 && player.x >= 2070){
floor_y = floor_base - 20;
player.y = floor_base - 20;
}
//JUMP
if( player.y == floor_base - 20 && player.x <= 700 && player.x >= 400){
floor_y = floor_base - 20;
player.y = floor_base - 20;
@jafstar
jafstar / trim.js
Created April 12, 2012 18:15
Javascript Trim Strings
/*** FROM http://www.somacon.com/p355.php ***/
//BOTH
function trim(stringToTrim) {
return stringToTrim.replace(/^\s+|\s+$/g,"");
}
//LEFT
function ltrim(stringToTrim) {
@jafstar
jafstar / upload.js
Created April 18, 2012 15:02
Appcelerator + Cloudinary + Image Upload
//CREATE WINDOW
var win = Ti.UI.createWindow({
title: 'Upload',
backgroundColor: '#FFF',
fullscreen: true,
navBarHidden: true
});
//PHOTO VIEW CONTAINER
@jafstar
jafstar / reverseJSON.js
Created April 25, 2012 09:06
Reverse JSON
//FROM http://developer.appcelerator.com/question/115941/-parsing-xml-in-reverse-order
for (var i = json.length - 1; i >= 0; i--)
{
doSomething(json[i].name, json[i].msg);
}
@jafstar
jafstar / explodeJS.js
Created May 18, 2012 07:28
Javascript explode() equivalent
console.log('searchVal split = ' + searchVal.split(' '));
var searchValArray = searchVal.split(' ');//.slice(1,-1);
console.log("SEARCH Array: " + searchValArray + "......");
var searchString = "";
for(var i in searchValArray){
searchString += String(searchValArray[i] + "+");
}
@jafstar
jafstar / cpanel-gzip.txt
Created May 26, 2012 04:03
cPanel Gzip
text/html text/plain text/xml text/css application/x-javascript application/javascript
Options +FollowSymLinks All -Indexes -MultiViews
#TIMEZONE
SetEnv TZ America/New_York
#America/Chicago
#America/Phoenix
#America/Los_Angeles
#TURN ON PHP 5.3 FOR SPECIFIC HOSTS
AddHandler application/x-httpd-php53 .php
@jafstar
jafstar / robots.txt
Created May 26, 2012 04:09
robots.txt
User-agent: *
Disallow: /admin
Disallow: /login
Disallow: /logout
Sitemap: /sitemap