This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def strip_tags | |
self.gsub(/<\/?[^>]*>/, '') if self | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert'); | |
function factorial(n) { | |
if (n > 1) { | |
return n * factorial(n - 1); | |
} | |
return 1; | |
} | |
assert.equal(factorial(1), 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /dev/null > ~/.bash_history && history -c && exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var request = require('request'); | |
var lat = -26.228889; | |
var lon = -52.670833; | |
var keyword = 'Pizzaria'; | |
var output = 'json'; | |
var radius = 2000; | |
var key = 'AIzaSyDVuLEXpSrOyB71IAS152xs7ACp-_HFCdw'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git reset --hard <commit_hash> | |
git push --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular | |
.module('app', []) | |
.controller('miCtrl', miCtrl); | |
function miCtrl ($scope) { | |
$scope.mensaje = "Mensaje desde el Controlador"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>AngularJS</title> | |
</head> | |
<body ng-app="app"> | |
<div class="container" ng-controller="miCtrl"> | |
<h1>{{mensaje}}</h1> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// url (obrigatório), options (opcional) | |
fetch('/api/url', { | |
method: 'get' | |
}).then(function(response) { | |
// Sucesso :) | |
}).catch(function(err) { | |
// Erro :( | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.XMLHttpRequest) { | |
request = new XMLHttpRequest(); | |
} else if (window.ActiveXObject) { | |
try { | |
request = new ActiveXObject('Msxml2.XMLHTTP'); | |
} | |
catch (e) { | |
try { | |
request = new ActiveXObject('Microsoft.XMLHTTP'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"short_name": "Pokedex.org", | |
"name": "Pokedex.org", | |
"display": "standalone", | |
"icons": [ | |
{ | |
"src": "img/icon-48.png", | |
"sizes": "48x48", | |
"type": "image/png" | |
}, |