This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var degrees2meters = function(lon,lat) { | |
var x = lon * 20037508.34 / 180; | |
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180); | |
y = y * 20037508.34 / 180; | |
return [x, y] | |
} | |
//test | |
lon= -77.035974 | |
lat = 38.898717 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The MIT License (MIT) | |
Copyright (c) 2013 Önder ALTINTAŞ | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--This program is free software: you can redistribute it and/or modify | |
--it under the terms of the GNU General Public License as published by | |
--the Free Software Foundation, either version 3 of the License, or | |
--(at your option) any later version. | |
--This program is distributed in the hope that it will be useful, | |
--but WITHOUT ANY WARRANTY; without even the implied warranty of | |
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
--GNU General Public License for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creates polar arc coordinates with given x0, y0 center coordinates, radius, start angle(polar degree north = 0), | |
// end angle, number of segments. | |
function createPolarArc(xO,yO,r,startAngle,endAngle,stepSize) | |
{ | |
var ring = []; | |
ring.push([xO,yO]) | |
var cartesianStartAngle = 90 - startAngle; | |
if(startAngle > endAngle) | |
{ | |
cartesianStartAngle = (360 + cartesianStartAngle)%360 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: Copy script -> community -> market -> go to my active listings -> right click on page -> | |
// inspect element -> console -> paste -> enter | |
var sumAll = function() | |
{ | |
var pageContent = document.body.innerHTML; | |
var regX = /\((.?[0-9].[0-9][0-9]).*?\)/g | |
var matches = pageContent.match(regX) | |
var total = 0; | |
for(var i = 0; i < matches.length;i++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WebApplication : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
RouteTable.Routes.MapRoute("HttpProxy", "proxy/{*path}", new { controller = "Proxy", action = "Http" }) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* loadJSONP( url, hollaback [, context] ) -> Null | |
* - url (String): URL to data resource. | |
* - hollaback (Function): Function to call when data is successfully loaded, | |
* it receives one argument: the data. | |
* - context (Object): Context to invoke the hollaback function in. | |
* | |
* Load external data through a JSONP interface. | |
* | |
* ### Examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
"use strict"; | |
// for better performance - to avoid searching in DOM | |
var content = $('#content'); | |
var input = $('#input'); | |
var status = $('#status'); | |
// my color assigned by the server | |
var myColor = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Center_an_element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doit(sec){ | |
console.log("execution is starting for "+ sec + " seconds. Now:"+(new Date()).toString()); | |
var now = Date.now(); | |
while(Date.now() - now < sec * 1000); | |
console.log("execution succeed for "+sec+" seconds. Now:"+(new Date()).toString()); | |
} | |
setTimeout(function(){ | |
doit(1); | |
},0); |
OlderNewer