Skip to content

Instantly share code, notes, and snippets.

View l0gicgate's full-sized avatar

Pierre B. l0gicgate

View GitHub Profile
@l0gicgate
l0gicgate / worker.php
Last active June 16, 2020 02:30
Roadrunner Worker
<?php
declare(strict_types=1);
use DI\Container;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Slim\Factory\AppFactory;
<?php
namespace Application\Middleware;
use PDO;
use Psr\Log\LoggerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
<?php
declare(strict_types = 1);
use Psr\Http\Message\ServerRequestInterface;
use Slim\Exception\HttpInternalServerErrorException;
use Slim\ResponseEmitter;
class ShutdownHandler
{
private ServerRequestInterface $request = null;
package com.ss.sys.ces.d;
import android.content.Context;
import com.ss.sys.ces.utils.NetInterface;
import java.io.IOException;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
public String a(String arg12) {
byte[] v12;
if(c.a == 0) {
return "1";
}
try {
f.a(b.a, "last report", Long.valueOf(Calendar.getInstance().getTimeInMillis()));
v12 = a.rb(b.a, arg12, null);
}
type IGenericType interface {
GetName() string
}
type GenericTypeRepository struct {
NativeType IGenericType
}
func (r *GenericTypeRepository) FindAll() (*[]IGenericType, error) {
var types []r.NativeType
package main
type Foo interface {
methodA() string
}
type Bar struct {
Foo
}
version: "3.7"
networks:
load-balancer-network:
external: true
client-network:
name: client-network
services:
<?php
$app->add(function ($request, $response, $next) {
$detectedIp = $request->getAttribute('ip_address', null);
$trustedIps = ['1.1.1.1', '2.2.2.2'];
if (!$detectedIp || !in_array($detectedIp, $trustedIps)) {
return $response->withJson(['error' => 'Unauthorized ip address', 401]);
}
<?php
declare(strict_types=1);
namespace Project\Actions;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
/**
* Class Action