Skip to content

Instantly share code, notes, and snippets.

@karmiphuc
karmiphuc / dung-huong-het-phuoc-bao.md
Created August 28, 2015 03:21
Đừng hưởng hết phước báo - trích sách

Bạn đang nghèo ư ..? Bạn đang kém phước. Bạn muốn thay đổi số phận..? Bạn đang giàu có...? Bạn có nhiều phước báu. Bạn có giàu có suốt đời..?

Có 1 lời khuyên cho bạn :

Bạn đừng hưởng hết phước báu, bạn hãy tích phước và kiệm phước..!!!Tôi có quen một "thầy bói" rất nổi tiếng. Thầy nói với tôi, trong mấy chục năm xem số cho người:

  • Phàm những ai giàu sớm thì thường chết sớm hoặc cuối đời không đâu vào đâu cả. Khi đó tôi không hiểu vì sao, hỏi thầy, thầy cười bảo : Trẻ nó sướng, cái gì trên đời nó cũng hưởng hết rồi mà không tạo ra được phước mới, còn gì nữa mà không chết sớm hay khổ cực cuối đời.

Sau này tôi mới nghiệm ra, quả vậy, đàn ông có tiền thì thường sa đọa, nhất là những người trẻ. Vì có tiền trong tay khi còn trẻ, đàn ông thường tìm đến rượu và gái. Tuyệt đối không nằm ngoài hai thứ này, chúng nó luôn đi cùng với nhau, gái rượu rượu gái, 1 đôi bạn thân. Rượu và gái không chỉ cướp đi sức khỏe mà nó còn cướp đi cả hạnh phúc gia đình và sự nghiệp đang thăng tiến. Thử nhìn lại xem bao nhiêu quan

@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.
@karmiphuc
karmiphuc / Notepad-Plus-Plus.tmTheme
Last active August 29, 2015 13:56
My SublimeText 3 setting
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Notepad-Plus-Plus</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@karmiphuc
karmiphuc / autoVer.php
Last active August 29, 2015 14:01
Step 6/9: Bust that Cache Wide Open! If you have read the configuration files for NGINX, you will have noticed some lines about a cache-buster for CSS and JS files. What it does is altering the link to your theme’s unified stylesheet and JS to something like style.1352707822.css, in which the number is the filemtime. So whenever you alter your f…
<?php
/**
* Automated cache-buster function via filemtime
**/
function autoVer($url){
$name = explode('.', $url);
$lastext = array_pop($name);
array_push(
$name,
filemtime($_SERVER['DOCUMENT_ROOT'] . parse_url($url, PHP_URL_PATH)),
@karmiphuc
karmiphuc / disableDevTools.html
Created May 29, 2014 10:09
Disable DevTools and console.log()
<script type="text/javascript">
if (window.webkitURL) {
var ish, _call = Function.prototype.call;
Function.prototype.call = function () { //Could be wrapped in a setter for _commandLineAPI, to redefine only when the user started typing.
if (arguments.length > 0 && this.name === "evaluate" && arguments [0].constructor.name === "InjectedScriptHost") { //If thisArg is the evaluate function and the arg0 is the ISH
ish = arguments[0];
ish.evaluate = function (e) { //Redefine the evaluation behaviour
throw new Error ('Rejected evaluation of: \n\'' + e.split ('\n').slice(1,-1).join ("\n") + '\'');
};
Function.prototype.call = _call; //Reset the Function.prototype.call
SELECT u.id, u.name,COUNT(*) as `total_cold_inquiries_received` FROM `internal_messages` im1
LEFT JOIN (
SELECT DISTINCT `sender_user_id` as `sui`,`recipient_user_id` as `rui`, `id` FROM `internal_messages` as `im2`
WHERE MOD(`im2`.id,2) = 1
GROUP BY `sui`,`rui`
) AS T
ON T.`sui` = `im1`.`recipient_user_id` AND T.`rui` = `im1`.`sender_user_id`, users as u
WHERE MOD(`im1`.id,2) = 1 AND (`im1`.id <= T.id OR T.id is NULL) AND u.id = im1.recipient_user_id
GROUP BY u.name
ORDER BY recipient_user_id
SELECT `sender_user_id`, name, COUNT(*) as `num_users_contacted`, COUNT(id) as `num_users_responded` FROM
(SELECT DISTINCT name,`owner_user_id`,`sender_user_id`,`recipient_user_id`,T.* FROM `internal_messages` im1
LEFT JOIN (
SELECT DISTINCT `sender_user_id` as `sui`,`recipient_user_id` as `rui`, `id` FROM `internal_messages` as `im2`
WHERE MOD(`im2`.id,2) = 1
GROUP BY `sui`,`rui`
) AS T
ON T.`sui` = `im1`.`recipient_user_id` AND T.`rui` = `im1`.`sender_user_id`, users as u
WHERE MOD(`im1`.id,2) = 1 AND (`im1`.id <= T.id OR T.id is NULL)
AND u.id = im1.owner_user_id) AS X
// Helper functions
/*
The next function we will use for inheritance is the inheritPrototype function.
This function succinctly implements the parasitic combination inheritance for us.
We pass in the parent object (or Super Class) and the child object (or Sub Class),
and the function does the parasitic combination inheritance:
makes the child object inherits from the parent object.
*/
function inheritPrototype(childObject, parentObject) {
// As discussed above, we use the Crockford’s method to copy the properties and methods from the parentObject onto the childObject
#!/bin/sh
# Credentials for a MySQL user with PROCESS, SUPER permissions
USERNAME=
PASSWORD=
# MySQL Server location
HOST=127.0.0.1
PORT=3306