Skip to content

Instantly share code, notes, and snippets.

View raphaelpor's full-sized avatar
:octocat:

Raphael Porto raphaelpor

:octocat:
  • Viaplay Group
  • Stockholm, Sweden.
View GitHub Profile
<!-- Twiiter -->
<a href="https://twitter.com/intent/tweet?text=TWEET_TO_SHARE&url=URL_TO_SHARE&via=USERNAME_TO_SHARE" target="_blank"
class="minshbt minshbt_twt fa fa-twitter"></a>
<!-- Facebook -->
<a href="https://www.facebook.com/sharer/sharer.php?u=URL_TO_SHARE" target="_blank"
class="minshbt minshbt_fb fa fa-facebook"></a>
<!-- Google+ -->
<a href="https://plus.google.com/share?url=URL_TO_SHARE" target="_blank"
class="minshbt minshbt_gg fa fa-google"></a>
<!-- Pinterest -->
<!-- Minimal Share Buttons -->
<link rel="stylesheet" href="//raphaelpor.github.io/minimal-share-buttons/src/minsharebts.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
@raphaelpor
raphaelpor / showpass.js
Created March 5, 2015 14:25
Javascript to show passwords.
(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) console.info("Passwords on this page:\n\n" + s); else console.info("There are no passwords in forms on this page.");})();
@raphaelpor
raphaelpor / grid-1.html
Created July 19, 2015 19:53
Curso de Ionic - Aula 07 - Grids
<div class="row">
<div class="col">.col</div>
<div class="col">.col</div>
<div class="col">.col</div>
</div>
<div class="row">
<div class="col">.col</div>
<div class="col">.col</div>
<div class="col">.col</div>
<div class="col">.col</div>
@raphaelpor
raphaelpor / header-1.html
Created July 19, 2015 21:31
Curso de Ionic - Aula 08 - Elementos
<ion-header-bar>
<h1 class="title">Header</h1>
</ion-header-bar>
@raphaelpor
raphaelpor / index.html
Created August 28, 2015 18:53
Electron CS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Olá Mundo!</title>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
background-color: #222;
color:#fff;
@raphaelpor
raphaelpor / es2015-aula11.js
Created February 22, 2016 03:55
Lithium - Curso de ES2015 - Aula 11
//Ex 1
function* idMaker() {
var index = 0
while ( index < 3 )
yield index++
}
var gen = idMaker()
console.log( gen.next() ) // 0
auto-indent
file-icons
highlight-selected
imdone-atom
laguage-javascript-jsx
linter
linter-eslint
linter-jsonlint
markdown-preview-plus
minimap
fetch('file.json') // URL de destino.
.then(response => { // 'response' possui todas informações da resposta.
if(response.ok) { // Bool para checar a respota.
return response.json(); // É necessário transformar o 'body' para json, para que possa ser manipulado
}
})
.then(data => { // Recebe o 'data' em formato json.
console.log(data);
})
.catch(err => { // Recebe um objeto contendo as informações do erro.
const config = {
method: 'POST',
body: JSON.stringify({ cat: 'grumpy' }),
cache: 'no-cache',
mode: 'no-cors',
}
fetch('http://localhost:8080/cats?categ=10&type=5', config)
.then(response => {
if(response.ok) {