Based on this gist compiled by Eric Pement - eric [at] pement.org
awk '/pattern/ {print "$1"}' # standard Unix shells
#!/bin/bash | |
# A simple script to recursively resample a bunch of files | |
# in a directory. Only certain file extensions (mp3, aac, | |
# flac, wav) are considered. | |
# | |
# It takes 2 command line options: `indir` and `outdir`. | |
# The destination (`outdir`) is relative to the current | |
# directory of where you were when the script was run. | |
# |
# -*- coding: utf-8 -*- | |
import logging | |
from collections import defaultdict | |
import overpy | |
from shapely.geometry.polygon import Polygon | |
from shapely.geometry.multipolygon import MultiPolygon | |
def ways2poly(ways): |
""" | |
This simple Jython script shows how to use Apache Lucene | |
directly in a Jython script | |
""" | |
# your usual Python imports | |
import sys | |
from contextlib import contextmanager | |
# add jars to classpath |
Based on this gist compiled by Eric Pement - eric [at] pement.org
awk '/pattern/ {print "$1"}' # standard Unix shells
cumwidth=7 | |
for i in {0..255}; do | |
printf "\x1b[38;5;${i}m [%03i] \x1b[0m" $i ; | |
if [ $i -eq $cumwidth ]; then | |
echo ; | |
if [ $cumwidth -ge 15 ]; then | |
((cumwidth+=6)) | |
else | |
((cumwidth+=8)) | |
fi ; |
Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118
Your problem with Vim is that you don't grok vi.
You mention cutting with yy
and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy
is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).
The "Zen" of vi is that you're speaking a language. The initial y
is a verb. The statement yy
is a simple statement which is, essentially, an abbreviation for 0 y$:
0 go to the beginning of this line. y yank from here (up to where?)
<!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" lang="en"> | |
<head> | |
<!-- Including this makes the code below crash --> | |
<!--script src="libs/polymer.min.js"></script--> | |
<script type="text/javascript" src="libs/jquery-1.9.1.js"></script> | |
</head> |
<polymer-element name="gr-test"> | |
<template> | |
<p>Hi there!</p> | |
</template> | |
<script> | |
Polymer('gr-test', { | |
ready: function() { | |
console.log("ready"); |
<html> | |
<head> | |
<script src="js/hammer.js-1.0.4/hammer.min.js"></script> | |
<!--script src="js/hammer.js-1.0.4/hammer.fakemultitouch.js"></script--> | |
</head> | |
<body > |