xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=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
from . import app | |
from flask.ext.sqlalchemy import get_debug_queries | |
if app.debug: | |
app.after_request(sql_debug) | |
def sql_debug(response): | |
queries = list(get_debug_queries()) | |
query_str = '' |
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 class="_li"> | |
<div id="pagelet_bluebar" data-referrer="pagelet_bluebar"> | |
<div id="blueBarDOMInspector" class="_21dp"> | |
<div class="_2t-8 _1s4v _2s1x"> | |
<div class="_2t-a _26aw _50ti _2s1y" role="banner"> | |
<div class="_2t-a _50tj"> | |
<div class="_2t-a _4pmj _2t-d _50tk"><a class="accessible_elem skipto" href="#newsFeedHeading" target="newsFeedHeading" id="u_0_0">Skip to News Feed</a> | |
<div class="_2t-e"> | |
<div class="_4kny"> | |
<h1 class="_19ea" data-click="bluebar_logo"><a class="_19eb" data-gt="{"chrome_nav_item":"logo_chrome"}" href="https://www.facebook.com/?ref=logo"><span class="_2md">Facebook</span></a></h1> |
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
<?xml version="1.0" encoding="utf-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | |
<sitemap> | |
<loc>http://www.amazon.com/sitemaps.f3053414d236e84.US_detail_page_sitemap_desktop_2014-03-22_107_0_0.xml.gz</loc> | |
</sitemap> | |
<sitemap> | |
<loc>http://www.amazon.com/sitemaps.f3053414d236e84.US_detail_page_sitemap_desktop_2014-03-22_107_100_0.xml.gz</loc> | |
</sitemap> | |
<sitemap> | |
<loc>http://www.amazon.com/sitemaps.f3053414d236e84.US_detail_page_sitemap_desktop_2014-03-22_107_101_0.xml.gz</loc> | |
</sitemap> |
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><img src="https://llamaly-assets.s3.us-east-2.amazonaws.com/images/logo-large.jpg" /></div> |
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
def human_delta(tdelta): | |
""" | |
Takes a timedelta object and formats it for humans. | |
Usage: | |
# 149 day(s) 8 hr(s) 36 min 19 sec | |
print human_delta(datetime(2014, 3, 30) - datetime.now()) | |
Example Results: | |
23 sec |
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 slugify($string, $toLower = true) { | |
$rules = "Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove;"; | |
if ($toLower) { | |
$rules .= ' Lower();'; | |
} | |
$string = transliterator_transliterate($rules, $string); | |
// Remove repeating hyphens and spaces (e.g. 'foo---bar' becomes 'foo-bar') |
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 .user import User | |
def init_db(db): | |
"""Add a save() function to db.Model""" | |
def save(model): | |
db.session.add(model) | |
db.session.commit() | |
db.Model.save = save |
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 Predis\Client; | |
class RedisSession implements SessionHandlerInterface { | |
private $redis; | |
private $keyPrefix; | |
private $maxLifetime; | |
/** |
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 | |
/** | |
* Checks the type of the given value against an array of valid types. | |
* | |
* If the value is a valid type, `true` is returned, if not, an | |
* InvalidArgumentException is thrown. | |
* | |
* // Throws: Invalid type: string, Expected type(s): array, ArrayAccess | |
* checktype('foo', ['array', 'ArrayAccess']); |
NewerOlder