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
// simply return a valid GeoJSON and it will be rendered on the map | |
const p = turf.point( | |
[0, 90], | |
{'marker-symbol': 'rocket', 'marker-color': '#F00', 'marker-size': 'large'} | |
); | |
const poly = turf.polygon([[ | |
[ | |
15, |
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
//below code just defines html2canvas written by some smart guy or something liek that. | |
!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(A="undefined"!=typeof globalThis?globalThis:A||self).html2canvas=e()}(this,function(){"use strict"; | |
var r=function(A,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])})(A,e)};function A(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}r(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var h=function(){return(h=Object.assign||function(A){for(var e,t=1,r=arguments.length;t<r;t++)for(var B in e=arguments[t])Object.prototype.hasOwnProperty.call(e,B)&&(A[B]=e[B]);return A}).apply(this,arguments)};function a(A,s,o,i){return new(o=o||Pr |
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 rollForDrop() { | |
// List of items, with their drop chances as weights | |
const items = { | |
"Sword": 0.2, | |
"Shield": 0.1, | |
"Potion": 0.3, | |
"Gold": 0.25, | |
"Gem": 0.15 | |
}; |
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); |
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 () { | |
"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
/** | |
* 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
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
// 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
// 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 |
NewerOlder