A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()):
- Headers
- Links
- Bold
| The regex patterns in this gist are intended to match any URLs, | |
| including "mailto:[email protected]", "x-whatever://foo", etc. For a | |
| pattern that attempts only to match web URLs (http, https), see: | |
| https://gist.github.com/gruber/8891611 | |
| # Single-line version of pattern: | |
| (?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])) |
| { | |
| "text": "RT @PostGradProblem: In preparation for the NFL lockout, I will be spending twice as much time analyzing my fantasy baseball team during ...", | |
| "truncated": true, | |
| "in_reply_to_user_id": null, | |
| "in_reply_to_status_id": null, | |
| "favorited": false, | |
| "source": "<a href=\"http://twitter.com/\" rel=\"nofollow\">Twitter for iPhone</a>", | |
| "in_reply_to_screen_name": null, | |
| "in_reply_to_status_id_str": null, | |
| "id_str": "54691802283900928", |
| <?php | |
| /** | |
| * Fibonacci: | |
| *============================================================================ | |
| * Class for computing fibonacci numbers using functional programming in PHP | |
| * Uses the formula at: http://jburrows.wordpress.com/2009/12/30/fibonacci/ | |
| */ | |
| class fibonacci { |
| <?php | |
| // Originally by Andrew Moore | |
| // Src: http://stackoverflow.com/questions/4795385/how-do-you-use-bcrypt-for-hashing-passwords-in-php/6337021#6337021 | |
| // | |
| // Heavily modified by Robert Kosek, from data at php.net/crypt | |
| class Bcrypt { | |
| private $rounds; | |
| private $prefix; |
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()):
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| <?php | |
| define('PASSWORD_SHA256', '$5$'); | |
| define('PASSWORD_SHA512', '$6$'); | |
| define('PASSWORD_BCRYPT', '$2y$'); | |
| define('PASSWORD_SCRYPT', '$7$'); // made up here | |
| $password_algos = array(); | |
| function password_register_algo($prefix, Callable $create, Callable $validate) { |
| /** | |
| * Create a web friendly URL slug from a string. | |
| * | |
| * Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support. | |
| * | |
| * Although supported, transliteration is discouraged because | |
| * 1) most web browsers support UTF-8 characters in URLs | |
| * 2) transliteration causes a loss of information | |
| * | |
| * @author Sean Murphy <sean@iamseanmurphy.com> |
I work as an analyst contractor, these days my roles are often a mixture of development and management. I have been asked by a countless number of people what they need to do to get the jobs I’m offered – and it’s simpler than most expect. The market for talented developers in the United Kingdom (and in many talent-lite communities around the world) is such that anyone who merely knows what they are doing has a very good chance of getting a job. Even a job contracting (which ordinarily has senior-level requirements).
To become a web developer with a good salary and employment expectations you need skills. Below I’ll provide a plan to get you towards the top of the largest market: PHP Web Development. Advanced knowledge of everything on this list would immediately make you one of the best, so just strive to have an exposure if not a comprehensive understanding (though the *starred points are essential). To learn these technologies you should use several in combination on on