Skip to content

Instantly share code, notes, and snippets.

@ramons03
ramons03 / 1x1transparentgif.html
Last active September 22, 2022 15:00
Base64 Encode of 1x1px Transparent GIF
Transparent
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
Black
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=">
@ramons03
ramons03 / Notepad++AdvancedSearch.txt
Last active February 28, 2024 23:10
Notepad++ Advanced search and replace. Null, Enter char, Tab, Regular Expressions, Etc.
Open the find/replace dialog.
At the bottom will be some Search mode options. Select "Extended (\n \r \t \0 \x...)"
In either the Find what or the Replace with field entries, you can use the following escapes:
\n new line (LF)
\r carriage return (CR)
\t tab character
\0 null character
\xddd special character with code ddd
@ramons03
ramons03 / OptimizedMathSquare
Created July 16, 2013 15:58
Here’s how to compute sqrt(x*x + y*y) without risking overflow.
max = maximum(|x|, |y|)
min = minimum(|x|, |y|)
r = min / max
return max*sqrt(1 + r*r)
@ramons03
ramons03 / setJSVarFromMVCJson.js
Last active December 19, 2015 18:19
Parse a json result from asp MVC controller and set a variable in javascript with an attribute from the json object.
function getData(url) {
var data;
$.ajax({
async: false, //thats the trick
url: url,
dataType: 'json',
success: function (response) {
data = response;
}
});
@ramons03
ramons03 / dabblet.css
Created March 4, 2012 17:17
cursowebappcss
body{
font-family:Tahoma,Arial,sans-serif;
font-size: 13px;
color:black;
background:white;
margin:8px;
}
h1{
font-size:19px;
margin-top:15px;
@ramons03
ramons03 / dabblet.html
Created February 15, 2012 12:39
holamundowebapp
<!-- content to be placed inside <body>…</body> -->
<!DOCTYPE html>
<html>
<head>
<title>Hola mundo desde el titulo</title>
</head>
<body>
<h1>Hola Mundo</h1>
<br />
<h1>HTML Hypertext Markup Language</h1>
@ramons03
ramons03 / helloworld.html
Created February 11, 2012 22:24
HTML Hola mundo
<!DOCTYPE html>
<html>
<head>
<title>Hola mundo desde el titulo</title>
</head>
<body>
<h1>Hola Mundo</h1>
<br />
<h1>HTML Hypertext Markup Language</h1>
<h2>Elementos</h2>
@ramons03
ramons03 / gist:1398030
Created November 27, 2011 19:33
Devuelve el maximo valor de repeticiones de acuerdo a una propiedad del objeto
public static int contarRepetidos(ArrayList<Objeto> a) {
Map<Integer, Integer> freqMap = new HashMap<Integer, Integer>();
for (Objeto obj : a) {
freqMap.put(obj.getValor(), (freqMap.get(obj.getValor()) == null ? 1 : (freqMap.get(obj.getValor()) + 1)));
}
return Collections.max(freqMap.values());
}