Skip to content

Instantly share code, notes, and snippets.

View navarr's full-sized avatar
🖥️
Magento

Navarr Barnier navarr

🖥️
Magento
View GitHub Profile
@navarr
navarr / Scrobbler.class.php
Created December 10, 2009 07:54
A simple protocol for sending Audio UPdates to an Audioscrobbler Service using the Audioscrobbler Realtime Submission Protocol (v1.2.1)
<?php
/*
Audioscrobbler Realtime Submission Protocol v1.2.1
Written by: Navarr T. Barnier
Version: 0.1
NOT FOR WEB SERVICES ACCOUNTS (maybe a later version)
Time Log
-----------------------------------------------------------
Date Start End Duration Description
// ==UserScript==
// @name Poke Application for Twitter
// @version 1.0.1
// @description Adds Poke Link to Twitter
// @include http://twitter.com/*
// @include https://twitter.com/*
// @include http://www.twitter.com/*
// @include https://www.twitter.com/*
// ==/UserScript==
@navarr
navarr / css3_lightbox.js
Created December 11, 2009 23:47
Very Simplistic Lightbox Script with specific functions for Images and HTML5 video
function checkForLightbox() {
if (!document.getElementById("lightbox") || !document.getElementById("lightbox_content")) {
createLightbox();
}
}
function createLightbox() {
var body = document.getElementsByTagName("body")[0];
var lightbox = document.createElement("div");
window.lightbox = new Array;
window.lightbox.load = new Array;
<?xml version="1.0" encoding="utf-16"?>
<GameDefinitionFile xmlns:baseTypes="urn:schemas-microsoft-com:GamesExplorerBaseTypes.v1" xmlns="urn:schemas-microsoft-com:GameDescription.v1">
<GameDefinition gameID="{3AFB9321-27F4-4C3B-8F43-167EE51E972C}">
<Name>Steam</Name>
<ReleaseDate>2010-01-02</ReleaseDate>
<Version>
<VersionNumber versionNumber="1.0.0.0" />
</Version>
<WindowsSystemPerformanceRating minimum="1" recommended="1" />
<GameExecutables>
#!/usr/local/php5/bin/php
<?php
error_reporting(E_ALL);
if(!isset($server)) { $server = $argv[1]; }
$servers = array
(
"yellow" => array("pdoayellow.servegame.com",1337)
);
list($return,$error) = getData($servers[$server]);
if ($return == null || $return == "") { list($status,$time,$users) = array(2,time(),0); }
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--[if lte IE 6]>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"> </script>
<script>CFInstall.check();</script>
<![endif]-->
</head>
<body />
</html>
@navarr
navarr / newTab.js
Created February 2, 2010 23:40
Open a Link in a New Tab using JavaScript
function newTab(url)
{
if(url.href) { url = url.href } // so that you can use onclick="return newTab(this);"
form = document.createElement("form");
form.setAttribute("method","get");
form.setAttribute("target","_blank");
form.setAttribute("action",url);
form.submit();
return false;
}
@navarr
navarr / onload.js
Created February 12, 2010 03:46
Tabbed Navigation for fromREADtoGREEN.com - I'm so proud of it
document.loadFuncs = new Array;
function loadUp()
{
for(i = 0;i < document.loadFuncs.length;i++)
{
document.loadFuncs[i]();
}
}
function whenLoad(loadfunc)
{
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Peanut Butter and Jelly Sandwich</title>
<style type="text/css">
body {
margin: 0px;
padding: 0px;
}
// Retrieve user’s Zipcode
// Demo at http://sandbox.gtaero.net/zipcode.html
function retrieve_zip(callback)
{
try { if(!google) { google = 0; } } catch(err) { google = 0; } // Stupid Exceptions
if(navigator.geolocation) // FireFox/HTML5 GeoLocation
{
navigator.geolocation.getCurrentPosition(function(position)
{
zip_from_latlng(position.coords.latitude,position.coords.longitude,callback);