Skip to content

Instantly share code, notes, and snippets.

View brenopolanski's full-sized avatar
🦙
Llama Llama

Breno Polanski brenopolanski

🦙
Llama Llama
View GitHub Profile
@brenopolanski
brenopolanski / create-new-branch.md
Created September 12, 2015 23:38
Create a new branch with git

Create the branch on your local machine and switch in this branch:

$ git checkout -b [name_of_your_new_branch]

Push the branch on github:

$ git push origin [name_of_your_new_branch]
@brenopolanski
brenopolanski / chosen-overflow-dialog.md
Created September 6, 2015 02:11
How to fix problem "overflow" in plugin Chosen on jQuery Ui Dialog
.ui-dialog .ui-dialog-content { overflow: visible !important; }
.ui-dialog { overflow: inherit !important; }
@brenopolanski
brenopolanski / input-broken-dialog.md
Last active September 6, 2015 00:46
spectrum and select2 input broken inside jQuery UI modal Dialog
/* jQuery UI - v1.10.2 - 2013-12-12  (and later)
 * http://bugs.jqueryui.com/ticket/9087#comment:30
 * http://bugs.jqueryui.com/ticket/9087#comment:27 - bugfix
 * http://bugs.jqueryui.com/ticket/4727#comment:23 - bugfix
 * allowInteraction fix
 * https://github.com/bgrins/spectrum/issues/276
 * https://github.com/select2/select2/issues/1246
 */
@brenopolanski
brenopolanski / resize-map-leaflet.md
Created August 27, 2015 12:25
Resize and center map Leaflet
map._onResize();
map.panTo(new Saiku.leaflet.LatLng(21.505, -0.09));
@joepie91
joepie91 / delay-promise.js
Last active July 29, 2022 20:02
ES6 Promise.delay
module.exports = function(duration) {
return function(){
return new Promise(function(resolve, reject){
setTimeout(function(){
resolve();
}, duration)
});
};
};
@brenopolanski
brenopolanski / reload-page-once.md
Created May 12, 2015 00:58
Reload an HTML page just once using JavaScript
if (window.location.href.substr(-2) !== '?r') {
    window.location = window.location.href + '?r';
}

or:

window.onload = function() {
@brenopolanski
brenopolanski / github-error-rpc.md
Created April 4, 2015 14:02
GitHub - error: RPC failed; result=52, HTTP code = 0

Allow doors in router:

  • 443/TCP (HTTP)
  • 9418/TCP (Git)
@brenopolanski
brenopolanski / gcc-error-eclipse.md
Created March 20, 2015 18:33
gcc - C: Undefined reference to pow Eclipse

Right click on your project -> properties -> C/C++ Build -> Settings -> GCC Linker -> Libraries -> add "m" -> Apply -> build

@brenopolanski
brenopolanski / font-linux.md
Created March 5, 2015 01:04
Add font TTF of Windows (Arial, Times New Roman etc.) in Linux Mint
$ sudo apt-get update
$ sudo apt-get install ttf-mscorefonts-installer
@brenopolanski
brenopolanski / conversion-hex-bin.cs
Last active August 29, 2015 14:16
Conversion hexadecimal to binary in CSharp
String valHexadecimal = "85C32";
String valBinary = Convert.ToString(Convert.ToInt32(valHexadecimal, 16), 2);
// valBinario equals >> 10000101110000110010