Skip to content

Instantly share code, notes, and snippets.

View franciscolourenco's full-sized avatar

Francisco Lourenço franciscolourenco

View GitHub Profile

Keybase proof

I hereby claim:

  • I am aristidesfl on github.
  • I am aristidesfl (https://keybase.io/aristidesfl) on keybase.
  • I have a public key ASDFLBvEDN4qPQiUMZ9_5AjwHZyCOWGYTEULPht7THSzCwo

To claim this, I am signing this object:

var bubble = {
"date": Date(),
"title": document.title,
"url": window.location.toString(),
"domain": window.location.hostname,
"meta": [document.querySelector("meta[property='og:type']"), document.querySelector("meta[property='og:description']")]
};
var keyBubbleObj = {bubble.url: bubble};
@franciscolourenco
franciscolourenco / index.js
Created September 9, 2016 15:34
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
axios = require('axios')
axios.defaults.baseURL = "https://api.icndb.com";
// Response 1
axios.get('/jokes/random').then(response => document.getElementById('response1').innerText = response.data.value.joke)
<style>*{margin:0;padding:0;box-sizing:border-box;}canvas{width:100%;height:100%}</style>
<canvas id='C'>
<script>
var c = C.getContext("2d"), R = Math.random;
C.width = window.innerWidth; C.height = window.innerHeight;
function dist(a,b,x,y){return Math.sqrt(Math.pow(a-x,2)+Math.pow(b-y,2))}
function generatePlanets(n){
var i, s = [50,100,150,200], m = s.slice(-1)[0];
@franciscolourenco
franciscolourenco / index.js
Created March 6, 2016 09:39
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
moment = require('moment');
var console = require('demo-console');
console.log(moment('2016-W32').format());
console.log(moment('2016-SU').format());
#!/usr/bin/env ruby
require 'json'
def load_json(url) JSON.parse(`wget -q -O- #{url}`) end
class String
#extend: http://misc.flogisoft.com/bash/tip_colors_and_formatting
def black; "\e[30m#{self}\e[0m" end
def red; "\e[31m#{self}\e[0m" end
def green; "\e[32m#{self}\e[0m" end
empty log
var http = require('follow-redirects').http;
//top 1000
var domains = ["google.com","facebook.com","youtube.com","yahoo.com","baidu.com","wikipedia.org","qq.com","linkedin.com","live.com","twitter.com","amazon.com","blogspot.com","taobao.com","google.co.in","sina.com.cn","wordpress.com","yahoo.co.jp","yandex.ru","bing.com","ebay.com","google.de","vk.com","hao123.com","163.com","tumblr.com","pinterest.com","google.co.uk","google.fr","googleusercontent.com","microsoft.com","msn.com","ask.com","mail.ru","google.co.jp","google.com.br","weibo.com","apple.com","paypal.com","google.ru","instagram.com","google.com.hk","xvideos.com","blogger.com","google.it","tmall.com","google.es","imdb.com","soso.com","craigslist.org","sohu.com","360.cn","go.com","amazon.co.jp","stackoverflow.com","bbc.co.uk","xhamster.com","google.com.mx","neobux.com","google.ca","fc2.com","cnn.com","imgur.com","alibaba.com","wordpress.org","flickr.com","espn.go.com","adcash.com","huffingtonpost.com","odnoklassniki.ru","t.co","conduit.com","thepira
/**
* peca
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
$ brew --config
HOMEBREW_VERSION: 0.9
HEAD: bb21ff5b6189dca067a00bd281ff3dd0bbcdf5e0
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A