Skip to content

Instantly share code, notes, and snippets.

<?php
function nonBlockingReadLineFromStdIn()
{
$read = array(STDIN);
$write = array();
$except = array();
var_dump('Before stream select.');
$result = stream_select($read, $write, $except, 0);
var_dump('After stream select.', $result);

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Maximus5
Maximus5 / install.cmd
Created June 20, 2014 21:15
ConEmu installation with single command
powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://conemu.github.io/install.ps1'))"
@Maximus5
Maximus5 / gist:8ebaf9a7c7134d928148
Created May 19, 2014 06:16
Run irssi in ConEmu task contents (supposing it's installation path is "C:\irssi")
"SET PATH=C:\irssi\bin;%PATH%" & SET PERL5LIB=lib/perl5/5.8 & SET TERMINFO_DIRS=terminfo & irssi.exe -cur_console:d:"C:\irssi"
@echo off
set USERPROFILE=%~dp0
if "%USERPROFILE:~-1,1%" == "\" set USERPROFILE=%USERPROFILE:~0,-1%
set HOMEDRIVE=%~d0
set HOMEPATH=%~p0
if "%HOMEPATH:~-1,1%" == "\" set HOMEPATH=%HOMEPATH:~0,-1%
diff -r 55cd783bbc2d src/os_win32.c
--- a/src/os_win32.c Sun Jan 05 13:29:26 2014 +0100
+++ b/src/os_win32.c Wed Jan 08 15:32:18 2014 +0900
@@ -232,6 +232,67 @@
static char_u *exe_path = NULL;
+ static BOOL
+read_console_input(
+ HANDLE hConsoleInput,
@Maximus5
Maximus5 / sleep_1.5ms.cmd
Created December 17, 2013 22:14
Need to "sleep" in your batch file? Use ConEmu's ANSI sequence. Note, real \x1B codes are not visible in gist, download file as RAW.
@echo Sleeping 1.5 sec...]9;1;1500\Done