Skip to content

Instantly share code, notes, and snippets.

@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
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,
@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%
@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"
@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'))"

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
<?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);
<value name="ColorTable00" type="dword" data="00181818"/>
<value name="ColorTable01" type="dword" data="00282828"/>
<value name="ColorTable02" type="dword" data="00383838"/>
<value name="ColorTable03" type="dword" data="00585858"/>
<value name="ColorTable04" type="dword" data="00b8b8b8"/>
<value name="ColorTable05" type="dword" data="00d8d8d8"/>
<value name="ColorTable06" type="dword" data="00e8e8e8"/>
<value name="ColorTable07" type="dword" data="00f8f8f8"/>
<value name="ColorTable08" type="dword" data="004246ab"/>
<value name="ColorTable09" type="dword" data="005696dc"/>
<value name="ColorTable00" type="dword" data="00181818"/>
<value name="ColorTable01" type="dword" data="00c2af7c"/>
<value name="ColorTable02" type="dword" data="006cb5a1"/>
<value name="ColorTable03" type="dword" data="00b9c186"/>
<value name="ColorTable04" type="dword" data="004246ab"/>
<value name="ColorTable05" type="dword" data="00af8bba"/>
<value name="ColorTable06" type="dword" data="0088caf7"/>
<value name="ColorTable07" type="dword" data="00d8d8d8"/>
<value name="ColorTable08" type="dword" data="00585858"/>
<value name="ColorTable09" type="dword" data="00b8b8b8"/>
@Maximus5
Maximus5 / -README.md
Last active August 29, 2015 14:13 — forked from jirutka/-README.md

How to use terminal on Windows without going crazy…

Windows is really horrible system for developers and especially for devops. It doesn’t even have a usable terminal and shell, so working with command line is really pain in the ass. If you really don’t want to switch to any usable system (OS X, Linux, BSD…), then this guide should help you to setup somewhat reasonable environment – usable terminal, proper shell, ssh client, git and Sublime Text as a default editor for shell.

Install stuff

  1. Download and install Git for Windows* with:
    • [✘] Use Git from the Windows Command Prompt
  • [✘] Checkout as-is, commit Unix-style line endings