Skip to content

Instantly share code, notes, and snippets.

MESSAGE:
nginx: 10.0.0.228 - - [06/Jun/2014:18:26:18 -0400] "POST /es/logstash-2014.06.06/_search HTTP/1.1" 200 26486 "http://example.org/index.html"; "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/34.0.1847.116 Chrome/34.0.1847.116 Safari/537.36" REQID:"-"
GROK PATTERN:
nginx: %{COMMONAPACHELOG} %{QS:referrer}; %{QS:agent} REQID:%{QS:reqid}
<?php
namespace AC\Authentication;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
<?php
R\chain::($myArray, [
[R\map, function ($i) { return $i*2; }],
[R\filter, function ($i) { return $i > 10; }]
])
(function (Ayamel, global) {
"use strict";
var template = '<div class="videoBox"><div id="youtubePlayer"></div></div>',
captionHolderTemplate = '<div class="videoCaptionHolder"></div>',
urlRegexen = [
new RegExp("/youtube:\/\/([A-Za-z0-9]+)/i"),
new RegExp("/https?:\/\/www\.youtube\.com\/watch\?v=([A-Za-z0-9]+)/i"),
new RegExp("/https?:\/\/www\.youtube\.com\/v/([A-Za-z0-9]+)/i"),
new RegExp("/https?:\/\/youtu\.be\/([A-Za-z0-9]+)/i")
@DavidMikeSimon
DavidMikeSimon / gist:9251496
Created February 27, 2014 14:48
Culling problems
Behold
describe "fml-ui", ->
it 'should be sane', ->
#foo
expect(true).toEqual(true)
expect(true).toEqual(true)
expect(true).toEqual(true)
expect(true).toEqual(false)
expect(true).toEqual(true)
return foo
<?php
trait Methods
{
public function __call($name, $args)
{
if (property_exists($this, $name)) {
return $this->$name;
}
<?php
trait Methods
{
public function __call($name, $args)
{
if (get_parent_class($this)) {
$x = parent::__call($name, $args);
if (!is_null($x)) { return $x; }
}
<?php
if ($parent = $cls->getParentClass()) {
if ($parent->hasMethod("acModelTraitsGetMethodMap")) {
$pmap = parent::acModelTraitsGetMethodMap();
$metaMap[$clsname] = array_merge($metaMap[$clsname], $pmap);
}
}
@DavidMikeSimon
DavidMikeSimon / gist:6674688
Created September 23, 2013 18:20
zeus ip addr
control@zeus:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet 169.254.169.254/32 scope link lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br100 state UP qlen 1000
link/ether 00:26:55:dc:ff:c2 brd ff:ff:ff:ff:ff:ff
inet6 fe80::226:55ff:fedc:ffc2/64 scope link