Skip to content

Instantly share code, notes, and snippets.

@alberto98fx
alberto98fx / devrant.html
Last active December 3, 2017 14:23
DevRant banner thingy javascript
<canvas id="banner" width="1200" height="400">
Your browser does not support the canvas element.
</canvas>
<script>
function banner(username,text){
fetch("https://devrant.com/api/get-user-id?app=3&username="+username).then(function(response) {
return response.json()
}).then(function(data){
return fetch("https://www.devrant.io/api/users/"+data.user_id+"?app=3&plat=2&content=all&skip=0");
}).then(function(resp){
<style>
body {
margin: 0;
padding: 0;
}
#container {
position: fixed;
touch-action: none;
}
@alberto98fx
alberto98fx / wa.js
Created November 30, 2017 21:06
WhatsApp tools
function saveFile(url) { //blob:url do not forget BLOB before the url
var filename = url.substring(url.lastIndexOf("/") + 1).split("?")[0];
var xhr = new XMLHttpRequest();
xhr.responseType = 'blob';
xhr.onload = function() {
var a = document.createElement('a');
a.href = window.URL.createObjectURL(xhr.response);
a.download = filename; // Set the file name.
a.style.display = 'none';
document.body.appendChild(a);