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 | |
# Sometimes you need to move your existing git repository | |
# to a new remote repository (/new remote origin). | |
# Here are a simple and quick steps that does exactly this. | |
# | |
# Let's assume we call "old repo" the repository you wish | |
# to move, and "new repo" the one you wish to move to. | |
# | |
### Step 1. Make sure you have a local copy of all "old repo" | |
### branches and tags. |
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
export const nodeListToArray = (nodeList) => { | |
return Array.prototype.slice.call(nodeList); | |
}; | |
export const querySelectorAllArray = (selector) => { | |
return nodeListToArray(document.querySelectorAll(selector)); | |
}; | |
export const objectAsArray = (obj) => { | |
return Object.keys(obj); |
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 | |
$app->add(function ($request, $response, $next) use ($container) { | |
// First execute anything else | |
$response = $next($request, $response); | |
// Check if the response should render a 404 | |
if ($response->getStatusCode() === 404 && $response->getBody()->getSize() === 0) { | |
// A 404 should be invoked | |
$handler = $container['notFoundHandler']; | |
return $handler($request, $response); |
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 | |
namespace Doon\Middleware; | |
use Memcached; | |
class Cache extends \Slim\Middleware { | |
protected $memcached, $settings, $ttl; | |
public function __construct($settings) |
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
.sour-tropical-gradient { background: -webkit-linear-gradient(90deg, #FD6F46 10%, #FB9832 90%); /* Chrome 10+, Saf5.1+ */ background: -moz-linear-gradient(90deg, #FD6F46 10%, #FB9832 90%); /* FF3.6+ */ background: linear-gradient(90deg, #FD6F46 10%, #FB9832 90%); /* W3C */ } | |
.subtle-gray-gradient { background: -webkit-linear-gradient(90deg, #dee1e1 10%, #f4f4f4 90%); /* Chrome 10+, Saf5.1+ */ background: -moz-linear-gradient(90deg, #dee1e1 10%, #f4f4f4 90%); /* FF3.6+ */ background: linear-gradient(90deg, #dee1e1 10%, #f4f4f4 90%); /* W3C */ } | |
.epic-bluegreen-gradient { background: -webkit-linear-gradient(90deg, #01a99c 10%, #0698b1 90%); /* Chrome 10+, Saf5.1+ */ background: -moz-linear-gradient(90deg, #01a99c 10%, #0698b1 90%); /* FF3.6+ */ background: linear-gradient(90deg, #01a99c 10%, #0698b1 90%); /* W3C */ } | |
.golden-face-gradient { background: -webkit-linear-gradient(90deg, #8e7a3f 10%, #b09a51 90%); /* Chrome 10+, Saf5.1+ */ background: -o-linear-gradient(90deg, #8e7a3f 10%, #b09a51 90%); /* Opera 11. |
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
{ | |
"bots": [ | |
"Googlebot", | |
"DotBot", | |
"AhrefsBot", | |
"MJ12bot", | |
"Slurp", | |
"spbot", | |
"bingbot", | |
"SemrushBot", |
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 | |
error_reporting(E_ALL ^ E_NOTICE); | |
abstract class Option { | |
protected $value; | |
public function __construct($value) { | |
if (isset($value)) return some($value); | |
else return none(); | |
} |
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 | |
namespace Bstd; | |
/** | |
* Class Template | |
* @package Bstd | |
*/ | |
class Template { | |
/** | |
* @var string |
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
var fs = window.RequestFileSystem || window.webkitRequestFileSystem; | |
if (!fs) { | |
console.log("check failed?"); | |
} else { | |
fs(window.TEMPORARY, | |
100, | |
console.log.bind(console, "not in incognito mode"), | |
console.log.bind(console, "incognito mode")); | |
} |
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() { | |
var hidden = "hidden"; | |
// Standards: | |
if (hidden in document) | |
document.addEventListener("visibilitychange", onchange); | |
else if ((hidden = "mozHidden") in document) | |
document.addEventListener("mozvisibilitychange", onchange); | |
else if ((hidden = "webkitHidden") in document) | |
document.addEventListener("webkitvisibilitychange", onchange); |
OlderNewer