Skip to content

Instantly share code, notes, and snippets.

View onderaltintas's full-sized avatar
🏠
Working@home

Önder onderaltintas

🏠
Working@home
View GitHub Profile
@gf3
gf3 / jsonp.js
Created June 18, 2009 18:18
Simple JSONP in vanilla JS
/**
* 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
@martinsik
martinsik / chat-frontend.js
Last active September 24, 2024 14:54
Node.js chat frontend and server
$(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;
@jkresner
jkresner / Global.asax
Created October 30, 2012 20:20
Asp .net Mvc 4 Proxy Server/Controller (For help with Cross Domain Request)
public class WebApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
RouteTable.Routes.MapRoute("HttpProxy", "proxy/{*path}", new { controller = "Proxy", action = "Http" })
}
}
@steveosoule
steveosoule / regex-string-whitelist.js
Last active October 15, 2022 18:59
JavaScript Regular Expression Whitelist for String
// in the regex, the carrot(^) negates the match, so if the stringToReplace contains something that is not a-z or 0-9 it will be replaced
// In this case the desired string will only be alpha numeric characters, stripping out spaces and symbols
// Help from: http://stackoverflow.com/questions/4374822/javascript-regexp-remove-all-special-characters
var desired = stringToReplace.replace(/[^a-zA-Z0-9]/gi, '')
@mapio
mapio / (Sort of) busy wait workaround for SpeechSynthesisUtterance.onend bug.markdown
Created November 29, 2015 19:52
(Sort of) busy wait workaround for SpeechSynthesisUtterance.onend bug
@evdokimovm
evdokimovm / index.js
Created June 19, 2016 14:10
JavaScript Convert Radians to Degrees and Degrees to Radians
// Convert from degrees to radians.
Math.radians = function(degrees) {
return degrees * Math.PI / 180;
}
Math.radians(90); // 1.5707963267948966
// Convert from radians to degrees.
Math.degrees = function(radians) {
return radians * 180 / Math.PI;
}
@wojteklu
wojteklu / clean_code.md
Last active November 15, 2024 07:19
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@SKalt
SKalt / Wfs-T-2-examples.md
Last active June 27, 2024 01:15
WFS-T 2.0.0 example requests

WFS-T 2.0.0 examples

Here I've translated the geoserver Web Feature Service Transactions (WFS-T) 1.0.0 examples into WFS-T 2.0.0 xml. All of these have been verified to work on geoserver 2.11.

Additional resources

action docs examples
delete docs examples
insert docs examples
replace docs example
update docs examples