Skip to content

Instantly share code, notes, and snippets.

🚀
Make it work!

Kande Bonfim kandebonfim

🚀
Make it work!
Block or report user

Report or block kandebonfim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kandebonfim
kandebonfim / makers.json
Last active Jul 10, 2018
An API Mockup file to be used in a frontend challenge
View makers.json
[
{
"name": "Flavio Ludgero",
"avatar": "https://startae.com/assets/images/team/flavio-ludgero-normal_2x-2cfa44b7.jpg",
"role": "Founder & CEO",
"tweet": "Service designer and longboard skate lover. Been through business consulting and digital agencies. Work with mentoring and business modeling using lenses of design.",
"twitter": "https://twitter.com/flavioludgero"
},
{
"name": "Rafael Torales",
@kandebonfim
kandebonfim / postgree_server.sh
Created May 24, 2017
How to start and stop postgree server
View postgree_server.sh
# Start Manually
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
# Stop Manually
pg_ctl -D /usr/local/var/postgres stop -s -m fast
View 4weeks
[{"UNITS":216863.95,"AVG_SALE_PRICE":27.4027,"Date":1490918400000,"MARGIN":5942659.315,"REVENUE":1.700522824E7,"CONVERSION":2.02,"PAGEVIEWS":486060.09,"UNITS_PER_ORDER":1.9747},{"UNITS":203857.95,"AVG_SALE_PRICE":27.4316,"Date":1490832000000,"MARGIN":5592153.693,"REVENUE":1.557704542E7,"CONVERSION":2.09,"PAGEVIEWS":472342.68,"UNITS_PER_ORDER":1.9478},{"UNITS":191919.68,"AVG_SALE_PRICE":27.5003,"Date":1490745600000,"MARGIN":5277862.032,"REVENUE":1.474203095E7,"CONVERSION":2.11,"PAGEVIEWS":458506.18,"UNITS_PER_ORDER":1.9253},{"UNITS":187973.59,"AVG_SALE_PRICE":27.6123,"Date":1490659200000,"MARGIN":5190392.777,"REVENUE":1.51979661E7,"CONVERSION":2.07,"PAGEVIEWS":458921.95,"UNITS_PER_ORDER":1.8987},{"UNITS":201077.68,"AVG_SALE_PRICE":27.7819,"Date":1490572800000,"MARGIN":5586336.623,"REVENUE":1.747735456E7,"CONVERSION":2.03,"PAGEVIEWS":480242.68,"UNITS_PER_ORDER":1.9171},{"UNITS":215274.09,"AVG_SALE_PRICE":27.95,"Date":1490486400000,"MARGIN":6016915.571,"REVENUE":1.946879568E7,"CONVERSION":2.02,"PAGEVIEWS":504199
View gist:2d40dd70c78b64c000e39b4bbc26788a
date,revenue,margin
24-Apr-07,93.24,80
25-Apr-07,95.35,73.5
26-Apr-07,98.84,72.6
27-Apr-07,99.92,92.5
30-Apr-07,99.80,99
1-May-07,99.47,101
2-May-07,100.39,102
3-May-07,100.40,99
4-May-07,100.81,106
@kandebonfim
kandebonfim / travelling-salesman-problem-in-r.R
Last active Feb 15, 2019
Travelling salesman problem in R
View travelling-salesman-problem-in-r.R
library(TSP)
library(tspmeta)
coords.df <- data.frame(long=runif(40, min=0, max=100), lat=runif(40, min=0, max=100))
coords.mx <- as.matrix(coords.df)
# Compute distance matrix
dist.mx <- dist(coords.mx)
# Construct a TSP object
@kandebonfim
kandebonfim / script.js
Created Feb 8, 2017
Scrapping catarse website.
View script.js
var allCards = document.querySelectorAll('.card-project')
var cards = [];
allCards.forEach( function(element, index) {
var currElem = {}
var name = element.querySelector('.link-hidden')
var author = element.querySelector('.w-hidden-small.w-hidden-tiny.fontsize-smallest.fontcolor-secondary.u-marginbottom-20')
var description = element.querySelector('.w-hidden-small.w-hidden-tiny.fontcolor-secondary.fontsize-smaller .link-hidden')
var percentage = element.querySelector('.card-project-stats .fontsize-base.fontweight-semibold')
var money = element.querySelector('.card-project-stats .fontsize-smaller.fontweight-semibold')
currElem.name = name.innerText;
View My sublime config
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.DS_store",
"*.gem",
"*.gz",
@kandebonfim
kandebonfim / script.js
Created Jul 28, 2016
Search for links containing an specific string in a webpage
View script.js
var str = 'www.maybeyourwebsite.here'
document.querySelectorAll('a').forEach(function(e) {
if (e.href.indexOf(str) > 0) {
console.log(e.href)
};
})
@kandebonfim
kandebonfim / array_random_numbers_coffeescript
Last active Feb 4, 2016
A gist to generate an array with random numbers in CoffeeScript
View array_random_numbers_coffeescript
random = (min, max) =>
Math.floor(Math.random() * (max - min) + min)
data = [1..100].map(() -> random(0,1000))
↑↑↑ Array length
// One line
data = [1..100].map(() -> Math.floor(Math.random() * (1000 - 0) + 0))
↑↑↑ Array length ↑max ↑min ↑min
You can’t perform that action at this time.