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
command-shift-P > Package > Package Generator: Generate Syntax Theme > mypackage
cd ~/.atom/packages/mypackage
apm login
apm develop mypackage
cd ~/github/mypackage
sudo chown -R username:wheel .
git commit -a -m 'checking everything in'
apm publish --tag v2.5.0 minor
@brenopolanski
brenopolanski / web-servers.md
Created March 13, 2016 21:37 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
var name = $(this.el).find("input[name='connname']").val();
var path = $(this.el).find("select[name='csvpath']").val();
var enabled = false;
if(schema.has.been.created){
var mondrianschema = $(this.el).find(".schemaselect").val();
enabled = true;
}
var c = "type=OLAP\n"+
"name="+name+"\n"+
"driver=mondrian.olap4j.MondrianOlap4jDriver\n"+
@brenopolanski
brenopolanski / htmlentity.js
Created March 3, 2017 14:31 — forked from CatTail/htmlentity.js
Javascript: encode(decode) html text into html entity
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {
@brenopolanski
brenopolanski / random.sh
Created March 3, 2017 18:38 — forked from rdeavila/random.sh
Renomear fotos aleatoriamente
#!/bin/bash
for fname in `ls *.jpg`
do
mv -nv ${fname} $RANDOM.jpg
done
@brenopolanski
brenopolanski / example.md
Created April 6, 2017 01:46 — forked from ericclemmons/example.md
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 <summary>Summary Goes Here</summary>
@brenopolanski
brenopolanski / google-translate-tooltip.user.js
Last active April 26, 2017 07:09 — forked from steelywing/google-translate-tooltip.user.js
google translate tooltip for firefox & chrome
// ==UserScript==
// @name Google Translate Tooltip
// @namespace steely.wing
// @version 1.10
// @description Translates selected text into a tooltip.
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @copyright 2014, Wing Leong (http://steelywing.iblogger.org/)
// @include *
// @require http://code.jquery.com/jquery-2.1.0.min.js
// @grant GM_getValue
@brenopolanski
brenopolanski / README.md
Created May 28, 2017 20:29 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@brenopolanski
brenopolanski / extract-attachments.py
Created July 7, 2017 01:21 — forked from stefansundin/extract-attachments.py
Extract attachments from emails that Gmail doesn't allow you to download. This is dumb. Please use Python >= 3.4.
#!/usr/bin/env python3
# Get your files that Gmail block. Warning message:
# "Anti-virus warning - 1 attachment contains a virus or blocked file. Downloading this attachment is disabled."
# Based on: http://spapas.github.io/2014/10/23/retrieve-gmail-blocked-attachments/
# Go to your emails, click the arrow button in the top right, "Show original", then "Download Original". Move the file to the same directory as this script.
import email
import sys
import os
@brenopolanski
brenopolanski / 1-sleep-es7.js
Created September 11, 2017 16:39 — forked from danharper/1-sleep-es7.js
ES7's async/await syntax.
// ES7, async/await
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
(async () => {
console.log('a');
await sleep(1000);
console.log('b');
})()