Skip to content

Instantly share code, notes, and snippets.

@ruedigerp
ruedigerp / Tmuxtakeover.conf
Created October 2, 2018 08:53
Tmux takeover
takeover() {
# create a temporary session that displays the "how to go back" message
tmp='takeover temp session'
if ! tmux has-session -t "$tmp"; then
tmux new-session -d -s "$tmp"
tmux set-option -t "$tmp" set-remain-on-exit on
tmux new-window -kt "$tmp":0 \
'echo "Use Prefix + L (i.e. ^B L) to return to session."'
fi
@ck-on
ck-on / ocp.php
Last active March 25, 2024 09:30
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@bakanis
bakanis / MixedTweets.md
Created December 2, 2012 22:01 — forked from loicdescotte/MixedTweets.md
How to push 2 mixed searches from twitter with Scala, Play2, Iteratee and Comet

##MixedTweets

We will see how to mix 2 twitter searches and push the results to the browser in real time.

First, checkout this mini project

To try it, you need to install Play 2.0

###Controller

@Dru89
Dru89 / prose.zsh
Created November 28, 2012 21:58
My ZSH Theme
# proze.zsh-theme
# Most of this was taken from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
# Determine what character to use in place of the '$' for my prompt.
function repo_char {
git branch >/dev/null 2>/dev/null && echo '☿' && return
echo '○'
}
# Display any virtual env stuff with python.
@hexathos
hexathos / function_getTimeFromNTPServer.php
Created November 18, 2012 02:04
getTimeFromNTPServer - PHP
<?php
/**
* This function is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This Software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@hexathos
hexathos / function_genUUID.php
Created November 18, 2012 01:15
Create UniqueID in php
<?php
function genUUID($prefix=null,$maxlength=36)
{
$s = strtoupper(
hash(
'whirlpool',hash('sha1',
microtime(true).crypt(
uniqid(
rand(),
true)
@jeffmccune
jeffmccune / root_user.pp
Created April 11, 2012 18:01
Manage the Root User Password on Linux
# = Class: site::root_user
#
# This is a simple class to manage the root user password.
# The shadow hash of an existing password can be easily obtained
# by running `puppet resource user root` on a Linux system
# that has the desired root password already set.
# Puppet will then manage this password everywhere.
#
# First, I set the password to "puppet" on one Linux node and then get back the
# shadow hash.
@donatj
donatj / ColorCLI.php
Created October 26, 2011 03:34
Simple CLI color class
<?php
class ColorCLI {
static $foreground_colors = array(
'bold' => '1', 'dim' => '2',
'black' => '0;30', 'dark_gray' => '1;30',
'blue' => '0;34', 'light_blue' => '1;34',
'green' => '0;32', 'light_green' => '1;32',
'cyan' => '0;36', 'light_cyan' => '1;36',