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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Mail::Message; | |
use Mail::Message::Convert::HtmlFormatText; | |
my $af = Mail::Message::Convert::HtmlFormatText->new; |
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
use mop; | |
use feature qw(postderef); | |
no warnings qw(experimental::postderef); | |
use Carp qw(confess); | |
use Package::Stash; | |
sub alias { | |
my $meta = shift; |
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
#!/usr/bin/env starlight | |
use AnyEvent::DNS::EtcHosts; | |
use Plack::Builder; | |
use Plack::App::Proxy; | |
builder { | |
enable 'AccessLog'; | |
enable 'Proxy::Connect'; | |
enable 'Proxy::Requests'; |
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
#!/usr/bin/env perl | |
use v5.14; | |
package MyApp { | |
use Moo; | |
use Wx ':everything'; | |
has url => is => 'ro'; |
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
SHELL=/bin/bash | |
* * * * * . $HOME/.profile && { cd $HOME && run-parts --report $HOME/cron.minutely; } |
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
ENABLED="true" | |
OPTIONS=" | |
--log-level=warning | |
--log-file=/var/log/mysql-proxy.log | |
--admin-username=proxy | |
--admin-password=proxy | |
--admin-lua-script=/usr/share/mysql-proxy/admin.lua | |
--proxy-backend-addresses=10.0.0.1:3306 | |
--proxy-backend-addresses=10.0.0.2:3306 |
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
package Mojo::Asset::Null; | |
use Mojo::Base 'Mojo::Asset'; | |
has size => 0; | |
sub add_chunk { | |
my ($self, $chunk) = @_; | |
$self->{size} += length($chunk); | |
return $self; |
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 django import http | |
from django.conf import settings | |
XS_SHARING_ALLOWED_ORIGINS = getattr(settings, 'XS_SHARING_ALLOWED_ORIGINS', '*') | |
XS_SHARING_ALLOWED_METHODS = getattr(settings, 'XS_SHARING_ALLOWED_METHODS', ['POST', 'GET', 'OPTIONS', 'PUT', 'DELETE']) | |
XS_SHARING_ALLOWED_HEADERS = getattr(settings, 'XS_SHARING_ALLOWED_HEADERS', ['Content-Type', '*']) | |
XS_SHARING_ALLOWED_CREDENTIALS = getattr(settings, 'XS_SHARING_ALLOWED_CREDENTIALS', 'true') | |
class XsSharing(object): |
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
import sys | |
DEFAULT_CHARSET = 'utf-8' | |
if sys.version_info >= (3, 0): | |
def b(string, charset=DEFAULT_CHARSET): | |
if isbytes(string): | |
return bytes(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
class lazy(object): | |
def __init__(self, default=None, name=None): | |
self.default = default | |
self.name = name | |
def __get__(self, obj, objtype): | |
if obj is None: | |
return self | |
if callable(self.default): | |
default = self.default(obj if obj is not None else objtype) |
OlderNewer