This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Usage: python thisfile.py "path/to/file.txt" > cleanfile.txt | |
import re | |
import sys | |
with open(sys.argv[1]) as fp: | |
for line in fp: | |
newline = re.sub(r'\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]', "", line) | |
print newline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from http://zzapper.co.uk/vimtips.html | |
------------------------------------------------------------------------------ | |
" new items marked [N] , corrected items marked [C] | |
" *best-searching* | |
/joe/e : cursor set to End of match | |
3/joe/e+1 : find 3rd joe cursor set to End of match plus 1 [C] | |
/joe/s-2 : cursor set to Start of match minus 2 | |
/joe/+3 : find joe move cursor 3 lines down | |
/^joe.*fred.*bill/ : find joe AND fred AND Bill (Joe at start of line) | |
/^[A-J]/ : search for lines beginning with one or more A-J |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Retrieved from http://cfenollosa.com/misc/tricks.txt | |
I have marked with a * those which I think are absolutely essential | |
Items for each section are sorted by oldest to newest. Come back soon for more! | |
BASH | |
* In bash, 'ctrl-r' searches your command history as you type | |
- Input from the commandline as if it were a file by replacing | |
'command < file.in' with 'command <<< "some input text"' | |
- '^' is a sed-like operator to replace chars from last command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<!-- NAME: 1 COLUMN --> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>*|MC:SUBJECT|*</title> | |
<style type="text/css"> | |
body,#bodyTable,#bodyCell{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"total": [ | |
{ | |
"id": 37, | |
"date": "January 2015", | |
"lanyrd": "http://lanyrd.com/2015/lnug-january/", | |
"speakers": [ | |
{ | |
"name": "Florian Motlik", | |
"url": "https://twitter.com/flomotlik", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
======= | |
Description: Add a dropdown to Chatlio to let our website audience select an option before entering the live-chat context to provide more information to the support agent. | |
Author: @orliesaurus | |
Credits: Thanks to John @ Chatlio for his help figuring it out! | |
======= | |
*/ | |
// First we wait for the event to be emitted by the chatlio widget when it is fully rendered on the page | |
document.addEventListener('chatlio.ready', function (e) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){ var style = document.createElement('style'), styleContent = document.createTextNode('.g { counter-increment: gindex !important; } .g:before { content: counter(gindex) !important; }'); style.appendChild(styleContent ); var ghead = document.getElementsByTagName('head'); ghead[0].appendChild(style); })(); |