(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix | |
;; and optionally can refer functions to the current ns. | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; | |
;; * :refer-clojure affects availability of built-in (clojure.core) | |
;; functions. |
#!/bin/bash | |
## v1.0.6 | |
## this script will gernerate css stats | |
### example output | |
# CSS STATS | |
# ---------- | |
# Floats: 132 |
#!/usr/bin/perl | |
use ElasticSearch; | |
use Text::CSV_XS; | |
my $csv_file = 'output.csv'; | |
open my $fh, '>:encoding(utf8)', $csv_file or die $!; | |
my $csv = Text::CSV_XS->new; |
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
curl -XPUT localhost:9200/_template/logstash -d ' | |
{ | |
"template" : "logs-*", | |
"settings" : { | |
"index.analysis.analyzer.default.type": "simple", | |
"index.cache.field.type": "soft", | |
"index.compress.stored": true, | |
"index.merge.policy.max_merged_segment": "5g", | |
"index.query.default_field": "@message", | |
"index.refresh_interval": "5s", |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
import os | |
import shutil | |
def make_dir(name): | |
raise Exception() | |
if not os.path.exists("target /" + name): | |
os.mkdir("target /" + name) | |
def main(): | |
file_list = os.listdir("./files") |
def main(): | |
f = open("twain.txt") | |
text = f.read() | |
f.close() | |
text = text.lower() | |
num_letters = [0] * 26 |
This gist includes components of a oozie (trigger file initiated) coordinator job - | |
scripts/code, sample data and commands; Oozie actions covered: hdfs action, email action, | |
java main action, hive action; Oozie controls covered: decision, fork-join; The workflow | |
includes a sub-workflow that runs two hive actions concurrently. The hive table is | |
partitioned; Parsing uses hive-regex serde, and Java-regex. Also, the java mapper, gets | |
the input directory path and includes part of it in the key. | |
Usecase | |
------- | |
Parse Syslog generated log files to generate reports; |