Skip to content

Instantly share code, notes, and snippets.

View msonnabaum's full-sized avatar

Mark Sonnabaum msonnabaum

  • Lithic
  • San Diego, CA
View GitHub Profile
library(ggplot2)
df <- read.csv('raw_gluster_replicate_stats.csv')
# Cast bricks to string
df$bricks <- as.character(df$bricks)
ggplot(df, aes(x=bricks, y=read, colour=bricks)) + geom_boxplot()
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 07c9d67..ccd4760 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -1280,111 +1280,6 @@ function drupal_page_header() {
}
/**
- * Sets HTTP headers in preparation for a cached page response.
- *
<?php
function modulename_block_info_alter(&$blocks, $theme, $code_blocks) {
// Turn on block cache for custom blocks.
if (isset($blocks['block'])) {
foreach ($blocks['block'] as $bid => &$block) {
$block['cache'] = DRUPAL_CACHE_GLOBAL;
}
#!/usr/bin/env ruby
require 'yaml'
require 'csv'
class SysBench
def initialize(file)
if not File.exists? file then
puts "File '#{file}' does not exist!"
exit
end
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
<?php
namespace Drupal\my_module\Plugins\Blocks
use Drupal\Component\Plugin\Annotations\Plugin;
use Drupal\Component\Plugin\Annotations\Type;
use Drupal\Component\Plugin\Annotations\Title;
use Drupal\Component\Plugin\Annotations\Description;
/**
<?php
function blah($wtf) {
echo "I'm php and I like turtles";
}
blah();
//PHP Warning: Missing argument 1 for blah()…
irb(main):008:0> path = '/mnt/gfs'
=> "/mnt/gfs"
irb(main):009:0> path !~ /[a-z]/i
=> false
irb(main):010:0> path =~ /[a-z]/i
=> 1
#!/usr/bin/env ruby
require 'yaml'
bad_uses = {}
Dir["**/*.php"].each do |file|
class_uses = []
file_contents = open(file).to_a
file_contents.grep(/^use/).each do |line|
if line.index '\\'
line = line.strip.split(/\\/).last
func WritingSettings()
setlocal guifont=courier:h18
"setlocal background=light
setlocal spell
setlocal columns=70
setlocal lines=80
setlocal linespace=10
setlocal nonumber
setlocal wrap
setlocal linebreak