Skip to content

Instantly share code, notes, and snippets.

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

Chau Giang bugb

🎯
Do it small and do it well!
View GitHub Profile
1.Hãy nói sự thật
2. Đừng làm những thứ mà bạn ghét
3. Hãy làm để có kinh nghiệm mà nói ( a.k.a chưa làm đừng chém)
5. Theo đuổi những thứ có ý nghĩa, đừng theo đuổi những gì hợp thời
6. Nếu được chọn, hãy là người thực sự làm, thay vì làm chỉ để người khác nhìn
7. Làm gì thì chú ý vào
8. Luôn cho rằng người đối diện biết ít nhất 1 thứ bạn không biết. Hãy lắng nghe đủ lâu và họ sẽ chia sẻ nó cho bạn
9. Hãy thực sự bỏ công sức vào việc duy trì mối quan hệ tình cảm
10. Không phải ai cũng đáng để bạn chia sẻ tin tốt
11. Không phải ai cũng đáng để chia sẻ tin xấu
@bugb
bugb / gist:6d3201fc73ca4e1127e16e9cb6aaaf5f
Created July 15, 2018 21:35
Dấu hiệu nào cho thấy bạn đang lãng phí đời mình
Q: Dấu hiệu nào cho thấy bạn đang lãng phí đời mình?
A: Ẩn danh (Upvote: 18,6k)
Bạn đang lãng phí đời mình nếu như:
1. Bạn thủ dâm thường xuyên, bạn nghĩ không có chuyện lặp lại đâu nhưng bạn đã lặp lại đúng chứ? Yeah, bạn đang lãng phí cuộc sống và năng lượng của mình đấy.
2. Lướt Whatsapp, Facebook, Instagram cứ mỗi 5 phút, kể cả khi chẳng có công việc gì quan trọng để kiểm tra.
3. Tốn thời gian để lên kế hoạch hơn là thực sự làm việc theo kế hoạch.
4. Thức dậy sau 6 giờ sáng. Đa số người không thành công thức dậy sau 6 giờ sáng.
5. Không đọc gì đó trong ngày.
6. Không tập thể dục. Không tập thể dục hằng ngày là một dấu hiệu rõ ràng cho việc bạn đang lãng phí đời mình.
@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,
@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 / 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 / traverse.js
Last active February 11, 2019 21:54
Get all nested keys of an Object (Not includes values is an array)
f = (x, st = []) => Object.keys(x).reduce((m, n) => {
s = [...st, n];
if (typeof x[n] == 'object') {
return [...m, ...f(x[n], s)]
f(x[n], s);
} else return [...m, s.join `.`]
}, [])
user = {
id: 101,
@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 / parseFunction.js
Created April 8, 2019 12:21 — forked from lamberta/parseFunction.js
Parse a JavaScript string function definition and return a function object. Does not use eval.
/* Parse a string function definition and return a function object. Does not use eval.
* @param {string} str
* @return {function}
*
* Example:
* var f = function (x, y) { return x * y; };
* var g = parseFunction(f.toString());
* g(33, 3); //=> 99
*/
function parseFunction (str) {