- http://serverfault.com/questions/416787/nginx-403-forbidden-error-hosting-in-user-home-directory
- rails deploy with rvm, capistrano, uniron, nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="fb-root"></div> | |
<script> | |
window.fbAsyncInit = function() { | |
FB.init({ | |
appId: 'xxxxxxxxxxxxx', | |
status: true, | |
cookie: true, | |
xfbml: true | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl - Raw upload | |
curl -X PUT -T image.png https://example.com/upload | |
# curl - Content-Type: multipart/form-data | |
curl -F name=logo -F file=@image.png https://example.org/upload | |
# curl - POST presigned URL (S3) |
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ . '/vendor/autoload.php'; | |
$s3 = Aws\S3\S3Client::factory($config); | |
$s3->registerStreamWrapper(); | |
$url = 's3://{$bucket}/{$key}'; | |
// Read CSV with fopen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
NewerOlder