Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@karmiphuc
karmiphuc / README.md
Created February 8, 2018 02:25 — forked from hernamesbarbara/README.md
fetch any mailto email addresses found on a web page

basic script to extract any email addresses from a website that can be found

usage

get all emails you can find from this page:

http://zombierecords.com/staff

@karmiphuc
karmiphuc / index.md
Created September 25, 2016 05:35 — forked from alekseykulikov/index.md
SUIT CSS naming convention for React.js application

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 6561 lines of CSS (and just 5 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@karmiphuc
karmiphuc / .git-commit-template.txt
Created March 11, 2016 05:01 — forked from adeekshith/.git-commit-template.txt
A Git commit template to make it easy to enforce a good and uniform commit message style across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@karmiphuc
karmiphuc / ssl-redirect.html
Created February 9, 2016 06:58 — forked from konklone/ssl-redirect.html
Force a quick redirect to HTTPS on Github Pages for your domain (and only your domain)
<script>
var host = "YOURDOMAIN.github.io";
if ((host == window.location.host) && (window.location.protocol != "https:"))
window.location.protocol = "https";
</script>
@karmiphuc
karmiphuc / create_labels.sh
Created January 26, 2016 08:05 — forked from omegahm/create_labels.sh
Create Gtihub labels from Bash
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
@karmiphuc
karmiphuc / bookmarklet_en
Created January 16, 2016 05:47 — forked from FiloSottile/bookmarklet_en
Krumiro, a bookmarklet to send a message to all your FB friends.
javascript:(function(){var msg_m_prompt='Insert the message for males. I\'ll replace %name with the recipient name.';var msg_f_prompt='Insert the message for females. I\'ll replace %name with the recipient name.';var throttle_prompt='Insert the pause in milliseconds between a friend and the next.';var exclude_prompt='Insert the list of friends to ignore, comma separated.';var exerror_alert='%s is not in your friends, you might have made a mistake. Do you want to continue?';var time_alert='The script will take %s seconds!';var done='Done!';if(!Array.prototype.indexOf){Array.prototype.indexOf=function(d){if(void 0===this||null===this)throw new TypeError;var c=Object(this),b=c.length>>>0;if(0===b)return-1;var a=0;0<arguments.length&&(a=Number(arguments[1]),a!==a?a=0:0!==a&&(a!==1/0&&a!==-(1/0))&&(a=(0<a||-1)*Math.floor(Math.abs(a))));if(a>=b)return-1;for(a=0<=a?a:Math.max(b-Math.abs(a),0);a<b;a++)if(a in c&&c[a]===d)return a;return-1};}function size(obj){var s=0,key;for(key in obj){if(obj.hasOwnProperty(key))s++
@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 / 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 |
+----------------+-------+---------------------+---------------------+