Skip to content

Instantly share code, notes, and snippets.

View thcipriani's full-sized avatar

Tyler Cipriani thcipriani

View GitHub Profile
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
function refreshTitleArtist(){
$.ajax({
type: "GET",
@thcipriani
thcipriani / gist:873541
Created March 16, 2011 23:33
Window.Open Launch Javascript
window.open('http://www.customchannels.net/streaming/puma/radio/', 'Puma','width=646,height=464,left=600,top=250,status=no,resizable=no,scrollbars=no');
@thcipriani
thcipriani / revstring.py
Created May 31, 2011 19:47
Reverse string iteration
k = 'Tardis'
i = 0
for letter in k:
i -= 1
print k[i]
# This will also work - extended slice method to reverse string:
# k = 'words'
# k = k[::-1]
# for letter in k:
@thcipriani
thcipriani / gateway.as
Created November 18, 2011 17:42
Function Not being called
gatewayListener.onLoadStart = function(target_mc) {
//target_mc.stop();
_root.gatewayClip = target_mc;
if(target_mc == _level0.vidWindowClip.vidImgLoader && _root.gatewayPlaying == 1) {
_root.vidWindowClip.createEmptyMovieClip("gatewayTimer",_root.vidWindowClip.getNextHighestDepth());
_root.vidWindowClip.gatewayTimer.onEnterFrame = function(){
getURL("javascript:writeOutput('300x250 Total Frames: "+target_mc._totalframes+"')");
if(target_mc._currentframe == target_mc._totalframes) {
getURL("javascript:writeOutput('gateway ended')");
trace("gateway ended");
<?php
//So when you login you're redirected to http://.../inventory?context=index which is this page
session_start();
if($_SESSION['LOGIN_STATUS'] != "OK"){
session_unset();
session_destroy();
echo 'You are not logged in, redirecting in 2 seconds
<meta http-equiv="Refresh" content="2; URL=index.php">';
}else{
@thcipriani
thcipriani / radiochumpop.html
Created December 16, 2011 23:56
Window Open
<a href="javascript:void(window.open('http://www.customchannels.net/streaming/ranch/index2.html', 'Ranch','width=630,height=440,left=600,top=250,status=no,resizable=no,scrollbars=no'))">Launch Button IMG or Text</a>
@thcipriani
thcipriani / gist:1640795
Created January 19, 2012 16:04
Subsectdiv usage
[subdivsect]
Here's the content you'll be typing for each subsection
[/subdivsect]
@thcipriani
thcipriani / ices-config.xml
Created February 10, 2012 22:06
ices-config.xml
<?xml version="1.0"?>
<ices>
<!-- run in background -->
<background>1</background>
<!-- where logs, etc go. -->
<logpath>/path/to/error/log</logpath>
<logfile>ices.log</logfile>
<!-- 1=error,2=warn,3=info,4=debug -->
<loglevel>4</loglevel>
<!-- set this to 1 to log to the console instead of to the file above -->
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='text'/>
<xsl:template match = "/icestats" >
{"song":
<xsl:for-each select='source'>
&quot;<xsl:value-of select="@mount" />&quot;: {
&quot;name&quot; : &quot;<xsl:value-of select="name"/>&quot;,
&quot;listeners&quot; : &quot;<xsl:value-of select="listeners" />&quot;,
&quot;description&quot; : &quot;<xsl:value-of select="description" />&quot;,
var ua = navigator.userAgent;
var isiPad = /iPad/i.test(ua) || /iPhone/i.test(ua) || /iPhone/i.test(ua);
// #### Functionality for Android et al. ###########
if (Modernizr.audio && !isiPad) {
var arr = [Modernizr.audio.ogg,Modernizr.audio.mp4,Modernizr.audio.mp3];
var works = [];
for (var i = 0; i<arr.length; i++){