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 | |
/** | |
* Send reconfigure=1 as a GET param to configure the example correctly. | |
* Omit to see the results from PHP's default SSL context settings. | |
* This example script reflects output from https://www.howsmyssl.com. | |
*/ | |
$reconfigure = isset($_GET['reconfigure']) ? (bool) $_GET['reconfigure'] : false; | |
/** | |
* https://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_Ciphersuite | |
*/ |
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 | |
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);} |
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 | |
$url = 'https://twitter.com/dhrrgn/status/440968615697715200'; | |
$embedly = new Embedly\Embedly([ | |
'key' => getenv('EMBEDLY_KEY'), | |
]); | |
if (preg_match('#https?://(?:www.)?twitter.com/[^/]+/status/([0-9]+)#i', $url, $match)) { | |
$oembed = json_decode(file_get_contents('https://api.twitter.com/1/statuses/oembed.json?id='.$match[1]), 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
#!/bin/bash | |
# This deploy hook gets executed after dependencies are resolved and the | |
# build hook has been run but before the application has been started back | |
# up again. This script gets executed directly, so it could be python, php, | |
# ruby, etc. | |
export COMPOSER_HOME="$OPENSHIFT_DATA_DIR/.composer" | |
if [ ! -f "$OPENSHIFT_DATA_DIR/composer.phar" ]; then | |
curl -s https://getcomposer.org/installer | php -- --install-dir=$OPENSHIFT_DATA_DIR |
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 | |
/** | |
* include paginator class from ProcessWire core, $config->paths->Modulename can | |
* be used to get the path of any module in PW. | |
*/ | |
require_once($config->paths->MarkupPagerNav . "PagerNav.php"); | |
/** |
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 | |
use ArrayAccess; | |
use Countable; | |
use IteratorAggregate; | |
class DataContainer implements ArrayAccess, Countable, IteratorAggregate | |
{ | |
use DataContainerTrait; | |
} |
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
// Lifted from https://stackoverflow.com/a/22103222 | |
if (typeof console === "undefined" || typeof console.log === "undefined") { | |
console.log = function(msg) { | |
alert(msg); | |
}; | |
} |
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
app.directive('infiniteScroll', [ | |
'$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) { | |
return { | |
link: function(scope, elem, attrs) { | |
var checkWhenEnabled, handler, scrollDistance, scrollEnabled; | |
$window = angular.element($window); | |
elem.css('overflow-y', 'scroll'); | |
elem.css('overflow-x', 'hidden'); | |
elem.css('height', 'inherit'); | |
scrollDistance = 0; |
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
from fabric.api import env, run, sudo, local, put | |
def production(): | |
"""Defines production environment""" | |
env.user = "deploy" | |
env.hosts = ['example.com',] | |
env.base_dir = "/var/www" | |
env.app_name = "app" | |
env.domain_name = "app.example.com" | |
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name } |
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 | |
use Phly\Conduit\Middleware; | |
use Phly\Conduit\FinalHandler; | |
use Phly\Conduit\Http\Request as RequestDecorator; | |
use Phly\Conduit\Http\Response as ResponseDecorator; | |
use Phly\Http\Response; | |
use Phly\Http\Server; | |
use Phly\Http\ServerRequestFactory; | |
require __DIR__ . '/../vendor/autoload.php'; |
OlderNewer