Skip to content

Instantly share code, notes, and snippets.

View MKorostoff's full-sized avatar

Matt Korostoff MKorostoff

View GitHub Profile
window.Modernizr = function(a, d, f) {
var g = {},
c = d.documentElement;
a = d.createElement("modernizr");
a = a.style;
var h = {}.toString,
k = {},
l = [],
n = l.slice,
p, r = {}.hasOwnProperty,
<?php
/**
* @author Matt Korostoff <mkorostoff@gmail.com>
*
* @copyright Licensed under the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version. http://www.gnu.org/licenses/
*
* @usage php path/to/this/file.php 'http://example.com'
*/
@MKorostoff
MKorostoff / deobfuscation.php
Created July 26, 2016 03:01
My attempt to de-obfuscate a PHP exploit file discovered on a hacked server.
<?php
/**
* First, we're going to establish an alphabet. We're never going to write code like:
*
* $foo = 'abc'
*
* Because it would be too easy to read. Instead, were' going to write code like:
*
* $alphabet = 'abcdefghijklmnopqrstuvwxyz';
<?php
/**
* Add jquery
*/
function matt_page_alter(&$page) {
$page['#attached']['library'][] = 'core/jquery';
}
parameters:
twig.config:
# Twig debugging:
#
# When debugging is enabled:
# - The markup of each Twig template is surrounded by HTML comments that
# contain theming information, such as template file name suggestions.
# - Note that this debugging markup will cause automated tests that directly
# check rendered HTML to fail. When running automated tests, 'twig_debug'
# should be set to FALSE.
name: 'matt'
type: theme
description: 'My first custom drupal 8 theme'
stylesheets:
all:
- css/styles.css
js:
js/modernizr.custom.04204.js: {}
regions:
header: 'Header'
name: Matthew
description: A simple hello world module.
core: 8.x
package: Custom
type: module
@MKorostoff
MKorostoff / gist:c94824a467ffa53f4fa9
Created April 16, 2015 22:01
Scroll into view with behat
/**
* @When I scroll :elementId into view
*/
public function scrollIntoView($elementId) {
$function = <<<JS
(function(){
var elem = document.getElementById("$elementId");
elem.scrollIntoView(false);
})()
JS;
#!/bin/sh
#
# @author Matt Korostoff <mkorostoff@gmail.com>
#
# @internal stop varnish, restart apache on port 80
#
# @category apache
#
# @copyright Licensed under the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
<?php
namespace Drupal\todo\Plugin\rest\resource;
use Drupal\Core\Session\AccountProxyInterface;
use Drupal\rest\Plugin\ResourceBase;
use Drupal\rest\ResourceResponse;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Psr\Log\LoggerInterface;