Skip to content

Instantly share code, notes, and snippets.

View emanoelqueiroz's full-sized avatar
💻
Programming...

Emanoel Queiroz emanoelqueiroz

💻
Programming...
View GitHub Profile
@luizcarraro
luizcarraro / Arvore.c
Created October 2, 2017 11:37
Arvore Binária do Brunão (Com suporte a Linux 64bits)
#include <stdio.h>
#include <stdlib.h>
typedef struct nodo{
int valor;
struct nodo *esquerda, *direita;
}Nodo;
Nodo *arvore;
@luizcarraro
luizcarraro / electron_context_menu.js
Created September 25, 2017 12:40
[ELECTRON] Menu-contexto com opções de copiar, colar e cortar em inputs e divs
(function () {
'use strict';
const remote = require('electron').remote;
const Menu = remote.Menu;
const MenuItem = remote.MenuItem;
const isAnyTextSelected = function () {
return window.getSelection().toString() !== '';
};
@mikaelbr
mikaelbr / destructuring.js
Last active February 20, 2025 13:00
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@marioplumbarius
marioplumbarius / remover-acentos.js
Created October 10, 2013 18:27
Funcao marota para remover acentos de strings. Foi utilizado expressao regular em cima de caracteres representados na base hexadecimal.
/**
* Remove acentos de caracteres
* @param {String} stringComAcento [string que contem os acentos]
* @return {String} [string sem acentos]
*/
function removerAcentos( newStringComAcento ) {
var string = newStringComAcento;
var mapaAcentosHex = {
a : /[\xE0-\xE6]/g,
e : /[\xE8-\xEB]/g,
@markSci5
markSci5 / Git checkout remote branch
Created July 3, 2013 07:08
Git checkout remote branch
//To fetch a branch, you simply need to:
git fetch origin
//This will fetch all of the remote branches for you. With the remote branches
//in hand, you now need to check out the branch you are interested in, giving
//you a local working copy:
git checkout -b test origin/test