Skip to content

Instantly share code, notes, and snippets.

View amal's full-sized avatar
👨‍💻

Art Shendrik amal

👨‍💻
View GitHub Profile
@amal
amal / bcrypt.php
Created March 18, 2012 17:11 — forked from dzuelke/bcrypt.php
How to use bcrypt in PHP to safely store passwords (PHP 5.3+ only)
<?php
// secure hashing of passwords using bcrypt, needs PHP 5.3+
// see http://codahale.com/how-to-safely-store-a-password/
// salt for bcrypt needs to be 22 base64 characters (but just [./0-9A-Za-z]), see http://php.net/crypt
// just an example; please use something more secure/random than sha1(microtime) :)
$salt = substr(str_replace('+', '.', base64_encode(sha1(microtime(true), true))), 0, 22);
// 2a is the bcrypt algorithm selector, see http://php.net/crypt

Breaking into Web Development

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).

When you have completed projects, you can upload them to github (or anot

@amal
amal / awesome-php.md
Created November 1, 2012 08:02 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries
@amal
amal / html.part.html
Created November 28, 2012 19:41 — forked from bladeofsteel/html.part.html
Элементарные социальные share-кнопки. see http://habrahabr.ru/post/156185/ & http://jsfiddle.net/rrZBR/1/
<a href="http://vk.com/share.php?url=URL&title=TITLE&description=DESC&image=IMG_PATH&noparse=true" target="_blank" onclick="return Share.me(this);"> {шарь меня правильно}</a>
<a href="http://www.facebook.com/sharer/sharer.php?s=100&p%5Btitle%5D=TITLE&p%5Bsummary%5D=DESC&p%5Burl%5D=URL&p%5Bimages%5D%5B0%5D=IMG_PATH" target="_blank" onclick="return Share.me(this);">{шарь меня правильно}</a>
<a href="http://connect.mail.ru/share?url=URL&title=TITLE&description=DESC&imageurl=IMG_PATH" target="_blank" onclick="return Share.me(this);">{шарь меня правильно}</a>
<a href="http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st.comments=DESC&st._surl=URL" target="_blank" onclick="return Share.me(this);">{шарь меня правильно}</a>
<a href="https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Ffiddle.jshell.net%2F_display%2F&text=TITLE&url=URL" target="_blank" onclick="return Share.me(this)">{шарь меня правильно}</a>​
@amal
amal / html.part.html
Created November 28, 2012 19:41 — forked from bladeofsteel/html.part.html
Элементарные социальные share-кнопки. (jQuery version) see http://habrahabr.ru/post/156185/
// Пример кнопок с минимальной настройкой
<p>Поделиться:
<button class="social_share" data-type="vk">ВКонтакте</button>
<button class="social_share" data-type="fb">Facebook</button>
<button class="social_share" data-type="tw">Twitter</button>
<button class="social_share" data-type="lj">LiveJournal</button>
<button class="social_share" data-type="ok">Одноклассники</button>
<button class="social_share" data-type="mr">Mail.Ru</button>
</p>
@amal
amal / gist:d708b1f0f225174205f0
Created October 18, 2014 16:27
Example of DSL for JSON in Kotlin
json {
"name" - "Rob Ashton"
"age" - 5
"address" - {
"number" - 444
"line one" - "never you mind"
}
"family".array(
{
"name" - "Gareth Ashton"
@amal
amal / CATCH_Keras_RL.md
Created July 8, 2016 14:30 — forked from EderSantana/CATCH_Keras_RL.md
Keras plays catch - a single file Reinforcement Learning example
@amal
amal / latency.txt
Created January 22, 2017 18:15 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
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
@amal
amal / setup_selenium.sh
Created August 14, 2017 21:32 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
@amal
amal / pr.md
Created October 19, 2017 11:40 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: