Skip to content

Instantly share code, notes, and snippets.

@karmiphuc
karmiphuc / 2015.12.15.md
Created December 15, 2015 11:54
2015.12.15.md

“Coming together is a beginning. Keeping together is progress. Working together is success.” ~ Henry Ford ~ While much has been written about the importance of teamwork in reaching objectives in organizations, there is often little thought and effort that goes into creating and developing effective teams. Groups of people are often thrown together for major projects without much effort being put into developing them into a team that will be motivated and work well together towards a common goal. While most organizations do well with the technical aspects of team projects, such as timelines and actions plans, it is on the people building part that they fall short. With a little effort, thought and foresight, many of the problems that plague teams can be avoided.

As a team leader here are 7 considerations when putting a team together.

Make sure everyone understands and buys into the WHY!

People generally will put minimum effort into something they consider unimportant or see as a make for work project. At th

@karmiphuc
karmiphuc / ReadWithPurposes.md
Created December 14, 2015 01:57
Không nên đọc nhiều sách

Không nên đọc nhiều sách

Đọc sách là để thực hành. Đó là mục đích của các markters.

Ngoại trừ làm trong lĩnh vực giáo dục và nghiên cứu, bạn không nhất thiết phải “chết chìm” trong các trang sách dày đặc kiến thức một cách vô ích. Vì nếu chỉ “học” mà không “hành” kiến thức sẽ vào tai này ra tai kia. Rất nhanh. Nguy hiểm hơn, có bạn còn có thể sẽ bị “ngộ chữ” vì đọc nhiều nhưng làm ít.

Một học giả đã nói rất hay thế này: “The greatest obstacle to discovery is not ignorance – it is the illusion of knowledge”. Tạm dịch: cản trở lớn nhất của việc khám phá không phải sự ngu dốt mà là ảo tưởng về tri thức.

Sợ nhất là kiến thức nửa vời. Sợ hơn nữa là sự ngộ nhận về sự hiểu biết của mình.

@karmiphuc
karmiphuc / words_bacDuong.md
Created November 27, 2015 04:40
reshare from fb Việt Quốc
  1. Kiềm chế là sức mạnh - Sức mạnh là kiềm chế
  2. Đạo đức là làm được gì... chứ không phải nói...
  3. Muốn nhanh thì phải từ từ
  4. Kẻ trưởng thành là kẻ biết dùng mình chứ không phải kẻ trên 18 tuổi
  5. Nhiều + vân vân là biểu hiện của bí
  6. Miếng phô mai có sẵn chỉ có ở trên cái bẫy chuột
  7. Kẻ đối diện bạn không ngu đâu
  8. Không nói chung... nói riêng đi: "Các đồng chí nên nhớ, các đồng chí đói thì các đồng chí phải ăn... Nói thế ai chả nói được, cái quan trọng nhất của cuộc đời là kiếm cơm ở đâu ra mà ăn."
  9. Cái gì cũng phải học... học quyết liệt đi
  10. Khốn khổ nhất của thằng đàn ông là đi ăn cắp thu nhập của chính mình
@karmiphuc
karmiphuc / README.md
Created November 26, 2015 06:45 — forked from wvengen/README.md
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@karmiphuc
karmiphuc / drop_inactive_tables.sql
Created September 30, 2015 08:32
Drop inactive tables (MyISAM engine) which haven't been accessed for 2 months
; Drop query
SET group_concat_max_len = 1024 * 1024 * 10;
SELECT CONCAT('DROP TABLE ',GROUP_CONCAT(CONCAT(table_schema,'.',table_name)),';') INTO @dropcmd FROM information_schema.tables
WHERE table_schema = 'test'
AND table_name LIKE '%temp\_data%'
AND DATE_ADD(update_time, INTERVAL +2 month) < CURDATE()
ORDER BY update_time DESC;
PREPARE str FROM @dropcmd; EXECUTE str; DEALLOCATE PREPARE str;
@karmiphuc
karmiphuc / rockthepost_code_challenge.md
Created September 15, 2015 09:28
RockThePost Coding Challenge

Pre-interview SQL Challenge | RockThePost Blog

We use the following SQL query challenge as a pre-interview test for new developers. Those who get it right are very experienced at SQL query writing.

In RockThePost, users can send each other messages via our internal message system. It works like Facebook. User "A" can compose a message and send it to user "B". There's a "Sent" box where messages you have sent appear and also an "Inbox" where new messages you have received appear that were written by other people addressed to you.

Each time a new message is generated, two records are stored in the database. One copy is owned by the sender. The other copy is owned by the recipient. Otherwise, they are identical.

@karmiphuc
karmiphuc / gist:e71e23f76b1d379236ac
Created September 15, 2015 09:22 — forked from dbtlr/gist:8319639
RockThePost Coding challenge: expected result 2
+----+-------+-------------------------------+
| id | name | total_cold_inquiries_received |
+----+-------+-------------------------------+
| 2 | Mike | 1 |
| 4 | Bill | 2 |
| 5 | Kate | 1 |
| 6 | Sue | 1 |
| 7 | Linda | 2 |
| 8 | Mary | 1 |
+----+-------+-------------------------------+
@karmiphuc
karmiphuc / gist:b4590081a06927b62190
Created September 15, 2015 09:22 — forked from dbtlr/gist:8319643
RockThePost Coding challenge: expected result 1
+----------------+-------+---------------------+---------------------+
| sender_user_id | name | num_users_contacted | num_users_responded |
+----------------+-------+---------------------+---------------------+
| 3 | Greg | 1 | 1 |
| 1 | John | 4 | 0 |
| 7 | Linda | 1 | 1 |
| 6 | Sue | 2 | 2 |
+----------------+-------+---------------------+---------------------+
@karmiphuc
karmiphuc / gist:5bd076b50f14af10efb3
Last active September 15, 2015 09:19 — forked from blockjon/gist:6430015
This script sets up the tables and example rows for our SQL coding challenge at RockThePost.
-- Setup some tables.
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1;
CREATE TABLE `internal_messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`owner_user_id` int(11) DEFAULT NULL,
@karmiphuc
karmiphuc / The Technical Interview Cheat Sheet.md
Last active August 28, 2015 03:37 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.