Skip to content

Instantly share code, notes, and snippets.

@kgsnipes
kgsnipes / index.html
Created January 27, 2012 10:49
Simple countdown in javascript and jquery
<html>
<head>
<script type="text/javascript" src="jquery-1.5.1.min.js"></script>
<script type="text/javascript">
var t;
var interval=36000*2;
$(document).ready(function(){
startCounter();
});
@kgsnipes
kgsnipes / IR Remote.pde
Created January 27, 2012 10:57
IR Remote control for arduino. Hex string Command is read serially and then transmitted from IRlED on pin 14
/*
This is the final implementation of reading the command from the serial as string
repeating it to the irled
*/
int IRled = 14; //this is the IR LED
int Begin = 13; //this indicates the status of the command sent
int serIn; // var that will hold the bytes-in read from the serialBuffer
@kgsnipes
kgsnipes / s107SerialControl.pde
Created January 27, 2012 21:52
s107 control . Reads 8 hex chars on serial and converts to 32 bit instruction
/*
This is the final implementation of reading the command from the serial as string
repeating it to the irled
3b3fff2f -- this is the vertical lift code
*/
int IRledPin = 14; //this is the IR LED
int Begin = 13; //this indicates the status of the command sent
int serIn; // var that will hold the bytes-in read from the serialBuffer
@kgsnipes
kgsnipes / escape.js
Created March 16, 2012 14:46
detect escape key on document
$(document).keydown(function(e){
var code = (e.keyCode ? e.keyCode : e.which);
if (code === 27) {
//do something
}
});
@kgsnipes
kgsnipes / urlparameters.js
Created March 16, 2012 14:54
retrieve url parameters in javascript
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (!results) { return 0; }
return results[1] || 0;
}
@kgsnipes
kgsnipes / index.html
Created March 17, 2012 13:13
jquery autocomplete
<html>
<head>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="kgautocomplete.js"></script>
<script type="text/javascript">
var keywords=[""," Victoria YHC 9019"," Wanton YHI 9022"," Whitby ZFM","10.0","10.5","1000 Mile Boot","1000 Mile By Wolverine","11.0","11.5","116-104","116-107","116-79","116-97","118 5","12.0","12.5","13.0","13.5","13666","138-21","14.0","14.5","14040","15.0","15.5","153-11","16.0","17665 Mens","205-122","213-50","252-106","252-108","252-43","252-95","252-98","338-29","36358","4.0","4.5","46288","5 3/4","5 Inch Boot Mens","5.0","5.5","6.0","6.5","67","7.0","7.5","8 Eye Boot","8 Eye Boot Floral","8.0","8.5","9.0","9.5","A La Mode","A-Lovely-K","A-Lovely-P","Abdul","Abigail","Abington by Timberland","Abya","Accept","Accomplice","Ace Up Your Sleeve","Acne","Ad Man","Adan","Addict","Addict Fishnet","Addison Boot","Adidas Originals","Adige","Aegean Waves","Aiko","Alaleh-KSK","Alanie","Alfea","Alfie Mens","Algisa","Alibi","Alice Silk",
@kgsnipes
kgsnipes / imageslider.html
Created May 9, 2012 18:37
image slider jquery
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>index</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="kaushik ganguly">
<!-- Date: 2012-05-09 -->
@kgsnipes
kgsnipes / kgimageslidercircular.html
Created May 9, 2012 22:23
circular image slider
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>index</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="kaushik ganguly">
<!-- Date: 2012-05-09 -->
@kgsnipes
kgsnipes / ios_1_help
Created September 21, 2012 09:31
ios problem with old library with sdk5.1
use compiler flag for arc problems in IOS -fno-objc-arc
//
// SSAppCache.h
// SQLite_ver1
//
// Created by kaushik ganguly on 24/09/12.
// Copyright (c) 2012. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <sqlite3.h>