Skip to content

Instantly share code, notes, and snippets.

View bugb's full-sized avatar
🎯
Do it small and do it well!

Kai Nguyen bugb

🎯
Do it small and do it well!
  • Apphub
  • In the cloud
View GitHub Profile
@bugb
bugb / v8.md
Created February 21, 2019 04:40 — forked from kevincennis/v8.md
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • sudo nano ~/.bash_profile
  • Add export PATH=/path/to/depot_tools:"$PATH" (it's important that depot_tools comes first here)
@bugb
bugb / Measure response time with curl
Created January 30, 2019 07:53 — forked from blackymetal/Measure response time with curl
How to measure request/response time with curl
curl -w "@curl-format.txt" -o /dev/null -s http://www.aduanacol.com
@bugb
bugb / cartesian.js
Created November 20, 2018 10:57 — forked from tapmodo/cartesian.js
const collection = [
{ attributeValue: ["RED", "GOLD"] },
{ attributeValue: ["16G", "32G", "64G"] },
{ attributeValue: ["PLUS"] }
]
function cartesian(data) {
const f = (a,b) => [].concat(...a.map(d => b.map(e => [].concat(d, e))))
const recurse = (a, b, ...c) => (b? recurse(f(a, b), ...c): a)
return recurse(...data)
@bugb
bugb / combinations.js
Created September 5, 2018 14:54 — forked from axelpale/combinations.js
JavaScript functions to calculate combinations of elements in Array.
/**
* Copyright 2012 Akseli Palén.
* Created 2012-07-15.
* Licensed under the MIT license.
*
* <license>
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,