Skip to content

Instantly share code, notes, and snippets.

View carlwiedemann's full-sized avatar

Carl Wiedemann carlwiedemann

View GitHub Profile
function findfunc {
grep -rn "function $1(" *| grep -vP "tags|patch$"| awk -F':' '{print $1,$2}' |
while read FILE LINE
do
mvim +${LINE} ${FILE}
done
}
<?php
namespace Drupal\layout\Plugin\block\block;
use Drupal\block\BlockBase;
use Drupal\Core\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
/**
* @Plugin(
/**
* Implements hook_block_alter().
*/
function bartik_block_alter(&$definitions) {
$definitions['page_primary_links']['class'] = 'Drupal\\bartik\\blocks\\PrimaryLinks';
$definitions['page_secondary_links']['class'] = 'Drupal\\bartik\\blocks\\SecondaryLinks';
}
<?php
namespace Drupal\bartik\blocks;
use Drupal\layout\Plugin\block\block\PagePrimaryLinks;
class PrimaryLinks extends PagePrimaryLinks {
/**
* Implements BlockInterface::build().
@markbates
markbates / gist:4240848
Created December 8, 2012 16:06
Getting Started with Rack

If you're writing web applications with Ruby there comes a time when you might need something a lot simpler, or even faster, than Ruby on Rails or the Sinatra micro-framework. Enter Rack.

Rack describes itself as follows:

Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks.

Before Rack came along Ruby web frameworks all implemented their own interfaces, which made it incredibly difficult to write web servers for them, or to share code between two different frameworks. Now almost all Ruby web frameworks implement Rack, including Rails and Sinatra, meaning that these applications can now behave in a similar fashion to one another.

At it's core Rack provides a great set of tools to allow you to build the most simple web application or interface you can. Rack applications can be written in a single line of code. But we're getting ahead of ourselves a bit.

@listrophy
listrophy / Custom.css
Created January 3, 2013 15:40
Put this in "~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css" to highlight your blocked stories.
.projects_stories_page .storyLabels a[title="blocked"] {
background-color: red;
color: white !important;
padding: 0 3px;
display: inline-block;
}
@jpstroop
jpstroop / c4l_loris_lightning_talk.md
Last active December 12, 2015 12:19
Lightning talk re: Loris <https://github.com/pulibrary/loris> for code4lib 2013.
@barryvdh
barryvdh / _ide_helper.php
Last active April 4, 2024 09:11
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@zmaril
zmaril / softwarehelpskill.md
Last active August 3, 2021 04:52
I want to write software that helps kill people.

I want to write software that helps kill people.

Please, before you call the police and get my github account put on lockdown, allow me a moment to explain. What I really want to do is work on projects that advance the human condition and improve people's lives. I've been in a mad dash to learn how to program for the past four or five years exactly because I realized how much good I could do for the world with a computer.

@star-szr
star-szr / xhprof-kit.sh
Last active February 7, 2016 14:16
xhprof-kit aliases and functions
# Creates a baseline from your current branch (should usually be 8.x).
alias bbranch='./xhprof-kit/benchmark-branch.sh `git rev-parse --abbrev-ref HEAD`'
# Using the baseline xhprof identifier from the bbranch command above will benchmark 8.x against the baseline and your patched branch.
# e.g.
# bbranches [XHPROF-IDENTIFIER] [twig-branch-name-here-1234456]
function bbranches() {
originalbranch="$(git rev-parse --abbrev-ref HEAD)"
base=$1
shift