def wrap(string, before: "<", after: ">")
"#{before}#{string}#{after}" # no need to retrieve options from a hash
end
# optional
wrap("foo") #=> ""
import requests as req | |
import sys | |
from dateutil.parser import parse | |
from PIL import Image | |
from StringIO import StringIO | |
# hi8-fetch.py <date> <zoom level> <output> | |
# E.g.: hi8-fetch.py 2016-01-13T22:10:00 8 2016-01-13T221000-z8.png | |
# Fetch Himawari-8 full disks at a given zoom level. | |
# Valid zoom levels seem to be powers of 2, 1..16, and 20. |
(ns wikiparse | |
(:require [clojure.java.io :as io] | |
[clojure.data.xml :as xml] | |
[clojure.zip :as zip] | |
[clojure.data.zip :as dzip] | |
[clojure.data.zip.xml :as zxml]) | |
(:import [ org.apache.commons.compress.compressors.bzip2 BZip2CompressorInputStream]) | |
(:gen-class :main true)) | |
(defn bz2-reader |
# load libraries | |
require 'rubygems' rescue nil | |
require 'wirble' | |
#require 'json' | |
alias q exit | |
class Object | |
def local_methods | |
(methods - Object.instance_methods).sort |
# configuration for osx clipboard support | |
set-option -g default-command "reattach-to-user-namespace -l sh" |
#!/usr/bin/env ruby | |
rss = '.+?Rss:\s+(\d+)' | |
share = '.+?Shared_Clean:\s+(\d+)' | |
share << '.+?Shared_Dirty:\s+(\d+)' | |
priv = '.+?Private_Clean:\s+(\d+)' | |
priv << '.+?Private_Dirty:\s+(\d+)' | |
MEM_REGEXP = /\[heap\]#{rss}#{share}#{priv}/m | |
def mem_usage_linux |