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 email | |
from email.policy import default | |
class MboxReader: | |
def __init__(self, filename): | |
self.handle = open(filename, 'rb') | |
assert self.handle.readline().startswith(b'From ') | |
def __enter__(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
RUN apt-get install -y libwebp-dev libde265-dev autotools-dev automake pkg-config libtool wget git make gcc pkg-config autoconf g++ curl | |
RUN wget https://github.com/strukturag/libheif/archive/v1.6.2.tar.gz && \ | |
tar -xvf v1.6.2.tar.gz && \ | |
cd libheif-1.6.2/ && \ | |
./autogen.sh && \ | |
./configure && \ | |
make && \ | |
make install |
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 * as React from 'react' | |
import validate from 'validate.js' | |
import { ValidationRules } from 'utils/validate' | |
import { findValueByPath } from 'utils/path' | |
type FieldConfiguration = { | |
key: string | |
validation?: ValidationRules | |
defaultValue?: any | |
nested?: FieldConfiguration[] |
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
for _, e := range config.Tasks { | |
err := c.AddFunc(e.Time, func() { | |
task := e | |
out, err := exec.Command("/bin/sh", "-c", task.Command).Output() | |
if err != nil { | |
raven.CaptureErrorAndWait(err, map[string]string{"command": e.Command, "time": task.Time}) | |
log.Printf("%s: %s", e.Command, err) | |
} | |
if e.Output != nil { | |
f, err := os.OpenFile(*task.Output, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600) |
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
# Compile RoadRunner | |
FROM golang:1.11 as RoadRunner | |
RUN git clone https://github.com/spiral/roadrunner --branch v1.2.8 /app | |
WORKDIR /app | |
RUN ./build.sh Linux | |
# Build PHP image |
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 | |
require __DIR__ . "/vendor/autoload.php"; | |
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory; | |
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory; | |
$relay = new Spiral\Goridge\StreamRelay(STDIN, STDOUT); | |
$psr7 = new Spiral\RoadRunner\PSR7Client(new Spiral\RoadRunner\Worker($relay)); |
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 | |
ini_set('display_errors', 'stderr'); | |
use App\Kernel; | |
use Spiral\Goridge\StreamRelay; | |
use Spiral\RoadRunner\PSR7Client; | |
use Spiral\RoadRunner\Worker; | |
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory; | |
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory; | |
use Symfony\Component\Debug\Debug; |
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="row"> | |
<div class="span12"> | |
<h1><?php echo $h1; ?></h1> | |
</div> | |
</div> | |
<form action="" method="POST"> | |
<div class="row"> | |
<div class="span6"> | |
<div class="row"> | |
<div class="span12"> |
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
public function actionLogger() | |
{ | |
$base = Yii::app()->db->createCommand()->select('*')->from('cr_log')->order("when DESC"); | |
$where = array(); | |
$where_replace = array(); | |
if (isset($_GET['username']) AND strlen($_GET['username']) > 0) { | |
$where[] = 'username LIKE \'%' . $_GET['username'] . '%\''; | |
} | |
if (isset($_GET['type']) AND $_GET['type'] != 0) { | |
$where[] = 'type=:type'; |
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 | |
/** | |
* Created by Alex Bond at UPDG. | |
* Date: 2/19/15 6:59 PM | |
*/ | |
namespace frontend\modules\store\controllers; | |
use common\models\Categories; |
NewerOlder