Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# List all opened files using only the /proc fs.
main() {
pids | file_descriptor_folder | xargs ls -l | remove_ls_total_lines | remove_ls_file_attributes | remove_non_files | less
}
pids() {
# we try all pids from 1 to the pid max and echo out the valid ones
for P in $(seq 1 $(cat /proc/sys/kernel/pid_max)); do
@VanTanev
VanTanev / bootstrap-rvm.sh
Last active December 17, 2015 18:49 — forked from TylerRick/bootstrap-rvm-erb.sh
Opinionated version of the bootstrap file
# Based on: https://gist.github.com/TylerRick/1961638
#
# vim: set ft=sh
#
# This script automatically bootstraps the system with everything it needs to run chef-solo.
# Note: This should only do the absolute minimum necessary to get chef-solo (and your recipes)
# working. All else should be done via chef recipes.
#===================================================================================================
# Config
<?php
namespace DG\CommonBundle\Model;
/**
* QueryFactory to satisfy PHPSpec
*
* @author Ivan Plamenov Tanev aka CraftyShadow <vankata.t@gmail.com>
*/
class QueryFactory
<?php
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
class myWidgetContentCkEditorView extends dmWidgetContentCkEditorView
{
const LINK_REGEX = '#href="(http?://)?(/)?(?<link_data>(\w+/\w+)|(page:\d+))(\s[\w\s-]+)?"#';
public function doRender()
{
return preg_replace_callback(self::LINK_REGEX, array($this, 'doLinks'), parent::doRender());
}