Update .bash_profile
with content:
export CLICOLOR=1
export PS1="\[\e[36m\]\w\[\e[0m\]$ "
alias ll='ls -GFhl' dir='ls -GFhl'
alias start=open
printf "\033]0;`date "+%a %d %b %Y %I:%M %p"`\007"
<?php | |
// See https://github.com/web-token/jwt-framework/tree/v1.3.9 for about JWT | |
function createAppleIDSecret() | |
{ | |
$privateKey = file_get_contents('/path/to/your/key'); | |
$keyId = 'key_id'; | |
$teamId = 'team_id'; | |
$clientId = 'client_id'; |
function multidimentional_array_map( $function, $arr ){ | |
$result = array(); | |
foreach ($arr as $key => $val){ | |
$result[$key] = (is_array($val) ? multidimentional_array_map($function, $val) : $function($val)); | |
} | |
return $result; | |
} |
# Install phpbrew | |
sudo apt-get update | |
sudo apt-get install libmcrypt-dev | |
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew | |
chmod +x phpbrew | |
sudo mv phpbrew /usr/local/bin/ | |
phpbrew init | |
[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
# curl - Raw upload | |
curl -X PUT -T image.png https://example.com/upload | |
# curl - Content-Type: multipart/form-data | |
curl -F name=logo -F [email protected] https://example.org/upload | |
# curl - POST presigned URL (S3) |
<?php | |
require __DIR__ . '/vendor/autoload.php'; | |
$s3 = Aws\S3\S3Client::factory($config); | |
$s3->registerStreamWrapper(); | |
$url = 's3://{$bucket}/{$key}'; | |
// Read CSV with fopen |
To be able to use PHP5 PDO with MS Access mdb files the following is required
(the same applies for the PHP4 style of using odbc_X
except for the
obviously PDO specific requirements):
In Linux this is achieved by intalling the php5-odbc
package: