Skip to content

Instantly share code, notes, and snippets.

View mcunha98's full-sized avatar
🏠
Working from home

Mauricio Cunha mcunha98

🏠
Working from home
View GitHub Profile
@mcunha98
mcunha98 / gist:cc67caf3f2392e27a9d440ce0f2558fa
Created July 15, 2019 17:37 — forked from alisterlf/gist:3490957
JAVASCRIPT:Remove Accents
function RemoveAccents(strAccents) {
var strAccents = strAccents.split('');
var strAccentsOut = new Array();
var strAccentsLen = strAccents.length;
var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
for (var y = 0; y < strAccentsLen; y++) {
if (accents.indexOf(strAccents[y]) != -1) {
strAccentsOut[y] = accentsOut.substr(accents.indexOf(strAccents[y]), 1);
} else
<script src="https://code.jquery.com/jquery-1.12.4.js" integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU=" crossorigin="anonymous"></script>
<input type="text" name="filtrofinal" id="filtrofinal" value="http://www.exampel.com/filters/filter?pagina=1" style="width:90%">
<br>
<a href="javascript:updateFiltroFinal('cor', 17)">cor 17</a>
<a href="javascript:updateFiltroFinal('cor', 18)">cor 18</a>
<a href="javascript:updateFiltroFinal('cor', 19)">cor 19</a>
<a href="javascript:updateFiltroFinal('tamanho', 12)">tamanho 12</a>
<a href="javascript:updateFiltroFinal('amor', 1)">amor 1</a>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="versao_arquivo">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:enumeration value="2.3"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="valor_nota_fiscal" type="xs:string"/>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
box-sizing: border-box;
}
body {
(function ($) {
$.postJSON = function (url, data) {
var o = {
url: url,
type: "POST",
dataType: "json",
contentType: 'application/json; charset=utf-8'
};
if (data !== undefined) {
o.data = JSON.stringify(data);
items.forEach(function(item){
console.log(item.id);
});
//ou
response.data.forEach(function(item){
console.log(item.id);
});
/*
Mesmo colocando no config do ckeditor a toolbar nunca aparecia, pois aqui dentro eu
tive que forçar para ser anexada ao toolbar insert por exemplo.
*/
CKEDITOR.plugins.add('strinsert',
{
requires : ['richcombo'],
init : function( editor )
{
//tag, texto, tooltip
@mcunha98
mcunha98 / image.php
Created December 5, 2019 00:04
Placeholder image only in PHP ,create a JPG file
<?php
// <img src="image.php?size=400x150&bg=eee&fg=999&text=Imagem+de+exemplo"/>
header ("Content-type: image/jng");
// Dimensions
$getsize = isset($_GET['size']) ? $_GET['size'] : '100x100';
$dimensions = explode('x', $getsize);
$image = imagecreate($dimensions[0], $dimensions[1]);
$bg = isset($_GET['bg']) ? $_GET['bg'] : 'ccc';
$bg = hex2rgb($bg);
$setbg = imagecolorallocate($image, $bg['r'], $bg['g'], $bg['b']);
<select id="anexos">
<option data-id="1">one</option>
<option data-id="2">two</option>
<option data-id="3">three</option>
</select>
$('#anexos').click(function(){
$(this).find(':selected').data('id')
});
do
$$
declare
registro record;
begin
for registro in select id_aparelho, atualizado_assistencia from tbl_assistencia where tipo_assistencia = 1 and status_assistencia = 2
loop
update tbl_aparelho set data_remanufaturado_aparelho = registro.atualizado_assistencia where id_aparelho = registro.id_aparelho;
end loop;
end;