Skip to content

Instantly share code, notes, and snippets.

<?php
$memcache = $this->getContainer()->get('busmap.memcached');
// $task = $input->getArgument('task', false);
$methods = get_class_methods($memcache);
$class = new \ReflectionClass(Memcached::class);
$class->getProperties();
$lines = [];
<html prefix="og: http://ogp.me/ns#">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video" />
<meta property="og:url" content="http://sites-manager.stageserver.org/test.html" />
<meta property="og:description" content="video.movie" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/smagliy-test-bucket/disable.png" />
<meta property="og:video" content="http://s3-eu-west-1.amazonaws.com/smagliy-test-bucket/GOPR9828.MP4" />
@avtehnik
avtehnik / vk-request.php
Created December 18, 2017 22:24
vk request example
<?php
require_once './vendor/autoload.php';
$auth = getjump\Vk\Auth::getInstance();
$auth->setAppId('____')->setScope('SCOPE')->setSecret('____')->setRedirectUri('http://____');
$token = $auth->startCallback();
$vk = getjump\Vk\Core::getInstance()->apiVersion('5.5')->setToken($token);
<?php
class mysqlisniffer extends \mysqli
{
private $queries = [];
public function query($query, $resultmode = MYSQLI_STORE_RESULT)
{
$this->queries[] = ['debug_backtrace' => array_map(function ($item) {
return [
<?php
$applicationMode = 'dev';
if ($applicationMode === 'dev') {
$isDevMode = true;
$cache = new \Doctrine\Common\Cache\ArrayCache();
} else {
$isDevMode = false;
Resources:
AWSEBAutoScalingGroup:
Type: AWS::AutoScaling::AutoScalingGroup
Properties:
HealthCheckType: ELB
HealthCheckGracePeriod: 600
option_settings:
- namespace: aws:autoscaling:launchconfiguration
option_name: IamInstanceProfile
https://www.sslforfree.com/create
aws --profile your-profile iam upload-server-certificate --server-certificate-name your-sert-name-YYYY-MM-DD --certificate-body file://certificate.crt --private-key file://private.key --certificate-chain file://ca_bundle.crt
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
@avtehnik
avtehnik / cli-config.php
Created April 5, 2018 15:04
include doctrine without symfony
<?php
use Doctrine\ORM\Tools\Console\ConsoleRunner;
define('ABSPATH', __DIR__ . '/../');
require_once('vendor/autoload.php');
require_once('doctrine-loader.php');
<?php
$data = [
file_get_contents("php://input"),
$_GET,
$_POST
];
@avtehnik
avtehnik / can dump.txt
Created June 19, 2018 10:07
Ford Fiesta mk6 2006 cand dump start engine stop engine
This file has been truncated, but you can view the full file.
can0 430 [7] 14 01 90 FF C0 00 20
can0 430 [7] 14 01 90 FF C0 00 20
can0 433 [8] 80 10 00 00 00 20 00 00
can0 430 [7] 14 01 90 FF C0 00 20
can0 430 [7] 14 01 90 FF C0 00 20
can0 430 [7] 14 01 90 FF C0 00 20
can0 210 [7] FF FF 30 68 90 00 01
can0 4B0 [8] 27 10 27 10 27 10 27 10
can0 210 [7] FF FF 30 68 90 00 02
can0 4B0 [8] 27 10 27 10 27 10 27 10