Skip to content

Instantly share code, notes, and snippets.

@Flard
Flard / tmux.md
Created July 24, 2019 12:58 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@Flard
Flard / repair-serialized-array.php
Created October 26, 2016 08:27
Fix voor repair serialized array.
<?php
/**************************************************************************
repairSerializedArray()
--------------------------------------------------------------------------
Extract what remains from an unintentionally truncated serialized string
Example Usage:
// the native unserialize() function returns false on failure
$data = @unserialize($serialized); // @ silences the default PHP failure notice
@Flard
Flard / gist:328f3e3502d8eda4fed5
Created November 20, 2015 11:01
split items over columns
$numColumns = 3;
$itemsPerColumn = ceil(count($items)/$numColumns);
$keys = array_keys($items);
$result = array();
for($i=0;$i<count($keys);$i++) {
$col = ($i % $numColumns);
$x = floor($i / $numColumns) + ($col * $itemsPerColumn);
$k = $keys[$x];
$result[$k] = $items[$k];
@Flard
Flard / gist:4541377
Created January 15, 2013 19:43
symfony format_date options
format_date
== tokens ==
G Era
y year
M mon
d mday
h Hour12
H hours
m minutes
@Flard
Flard / gist:3002721
Last active October 6, 2015 13:48
symfony logger in code
if (sfConfig::get('sf_logging_enabled')) {
sfContext::getInstance()->getEventDispatcher()->notify(new sfEvent('category', 'application.log', array('message' => 'Message', 'priority' => sfLogger::DEBUG)));
}