Skip to content

Instantly share code, notes, and snippets.

View thejeshgn's full-sized avatar

Thejesh GN thejeshgn

View GitHub Profile
@lxbarth
lxbarth / index.html
Created August 7, 2013 21:06
via:geojson.io
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.marker-properties {
border-collapse:collapse;
@lxbarth
lxbarth / index.html
Last active December 22, 2015 23:09
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title></title>
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script>
<script src='leaflet-hash.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.ie.css' rel='stylesheet'>
// force certain pages to be refreshed every time. mark such pages with
// 'data-cache="never"'
//
jQuery('div').live('pagehide', function(event, ui){
var page = jQuery(event.target);
if(page.attr('data-cache') == 'never'){
page.remove();
};
});
@mhawksey
mhawksey / TAGS v5.1.1.js
Last active August 17, 2016 08:27
Version 5.1.1 of TAGS script. Open Tools > Script editor and replace the TAGS.gs code with the one below
// This code excluding Google(c) Code tab:
/*
Copyright 2013 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
# Basic text search with relevancy for MongoDB.
# See http://blog.tty.nl/2010/02/08/simple-ranked-text-search-for-mongodb/
# Copythingie 2010 - Ward Bekker - ward@tty.nl
#create (or empty) a docs collection
doc_col = MongoMapper.connection.db('example_db').collection('docs')
doc_col.remove({})
#add some sample data
doc_col.insert({ "txt" => "it is what it is"})
@thejeshgn
thejeshgn / batchEntoKn.php
Created February 4, 2011 16:20
Transliterating english to Kannada
<?php
/**
Trasliterate method takes 5 , seaparated english words and transliterates them into Kannada,
The result is an array of words in the same order. This uses Non public Google online transliteration API for this.
When you run this method give a 10ms seconds gap between each call to be on the safer side.
By : Thejesh GN http://thejeshgn.com
More: http://thejeshgn.com/2011/02/04/batch-transliterating-names-into-kannada-using-google-api/
@bradleybuda
bradleybuda / instrument_ajax.js
Created March 30, 2011 18:21
Instrument all jQuery AJAX events
_.each(['Start', 'Stop', 'Complete', 'Error', 'Success', 'Send'], function(s){
$(window)['ajax' + s](function(event, xhr, options) {
// your instrumentation goes here
console.log('ajax' + s);
});
});
@nathos
nathos / amznshortener.js
Created May 25, 2010 20:39
AmznShortener - Javascript bookmarket source for an Amazon.com short-link generator.
(function(){
var aff = 'nathos-20'; // replace 'nathos-20' with your Amazon affiliate ID, including the '-20'
if (!document.getElementById('ASIN')) {
alert('Can\'t find an Amazon product ID');
return;
}
var asin = document.getElementById('ASIN').value;
prompt(
'Here is the shortened affiliate link:',
'http://amzn.com/' + asin + '?tag=' + aff);
from microbit import spi, sleep, pin16
import array
import gc
class LoRa(object):
"""
Radio - LoRa. Single channel.
"""
def __init__(self, Frequency=434.450, Mode=1):
@amix
amix / amazon_sender.py
Created May 17, 2011 13:39
Amazon SES helper script using boto
# -*- coding: utf-8 -*-
"""
amazon_sender.py
~~~~~~~~
Python helper class that can send emails using Amazon SES and boto.
The biggest feature of this class is that encodings are handled properly.
It can send both text and html emails.
This implementation is using Python's standard library (which opens up for a lot more options).