Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
This file contains hidden or 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
license: gpl-3.0 | |
height: 600 | |
border: no |
This file contains hidden or 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 | |
class ReconnectingPDO | |
{ | |
protected $dsn, $username, $password, $pdo, $driver_options; | |
public function __construct($dsn, $username = "", $password = "", $driver_options = array()) | |
{ | |
$this->dsn = $dsn; | |
$this->username = $username; | |
$this->password = $password; |
This file contains hidden or 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 | |
/** | |
* Конвертер регулярного выражения | |
* | |
* @author Pakhtinov Dmitriy | |
* @copyright 2012 Pakhtinov Dmitriy | |
* @data 14.11.2012 | |
*/ | |
class PCREConverter { |
This file contains hidden or 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
package main | |
// sort a map's keys in descending order of its values. | |
import "sort" | |
type sortedMap struct { | |
m map[string]int | |
s []string | |
} |
Note: replace {{server}} with your domain or ip
- Login as the ec2-user
ssh -i key.pem ec2-user@{{server}}
- Switch to administrator
sudo -i
This file contains hidden or 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
/* | |
Heavily inspired by the PHP implementation made by Ahmad Amarullah (available at http://code.google.com/p/php-mail-domain-signer/), with the help of http://phpjs.org/. | |
Setup: | |
In dkim-raw-email.js, change the location of your private key and the associatedDomain accordingly to your needs. | |
Example of use (using aws-lib, https://github.com/mirkok/aws-lib): |
This file contains hidden or 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 | |
function describe($testedClass, callable $tests) { | |
print ("$testedClass" . PHP_EOL); | |
$tests(); | |
} | |
function it($testName, callable $test) { | |
print(" $test" . PHP_EOL); | |
$test(); |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Example of how to parse short/long options with 'getopt' | |
# | |
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
echo "$OPTS" |
This file contains hidden or 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 | |
function assoc_array_map($cb, $arr) { | |
$new_array = array(); | |
foreach ($arr as $key => $value) { | |
array_push($new_array, $cb($key, $value)); | |
} | |
return $new_array; |