this..
taking poorly written code,
writing poorly written alternative,
but in less lines,
which now needs comments to decipher...
is not an argument.
| // https://github.com/m59peacemaker/browser-insular-observer | |
| // | |
| // Usage: | |
| // let observe = InsularObserver(MutationObserver); | |
| // observe(document.documentElement, options, function(documentElementEntry) {...}); | |
| // | |
| import keyMaster = require('key-master') |
| ;; fast startup time | |
| (setq gc-cons-threshold most-positive-fixnum) | |
| (defvar original-file-name-handler-alist file-name-handler-alist) | |
| (setq file-name-handler-alist nil) | |
| (add-hook 'emacs-startup-hook | |
| #'(lambda () (setq gc-cons-threshold 800000 | |
| file-name-handler-alist original-file-name-handler-alist))) | |
| ;; (add-hook 'emacs-startup-hook | |
| (add-hook 'after-init-hook | |
| (lambda () |
this..
taking poorly written code,
writing poorly written alternative,
but in less lines,
which now needs comments to decipher...
is not an argument.
| #!/bin/sh | |
| if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi | |
| exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit | |
| -- another way of waiting until an app is running | |
| on waitUntilRunning(appname, delaytime) | |
| repeat until my appIsRunning(appname) | |
| tell application "Messages" to close window 1 | |
| delay delaytime | |
| end repeat |
| class LsofDownloadStrategy < CurlDownloadStrategy | |
| def stage | |
| super | |
| safe_system "/usr/bin/tar", "xf", "#{name}_#{version}_src.tar" | |
| cd "#{name}_#{version}_src" | |
| end | |
| end | |
| class Lsof < Formula | |
| desc "Utility to list open files" |
| import aws from 'aws-sdk'; | |
| import fs from 'fs'; | |
| import ini from 'ini'; | |
| import path from 'path'; | |
| // compatibility with aws-cli | |
| let cliCacheFolder = path.join(process.env.HOME, '.aws', 'cli', 'cache'); | |
| let awsProfile = process.env.AWS_PROFILE || process.env.AWS_DEFAULT_PROFILE; | |
| if (awsProfile) { | |
| try { |
| let semver = require('/usr/local/lib/node_modules/npm/node_modules/semver'); | |
| let lockJsBeautifier = function(name, version, {deps, _depsName, pkg}) { | |
| if (name !== 'js-beautify') { | |
| return; | |
| } | |
| if (!semver.satisfies('1.7.0', version)) { | |
| return; | |
| } |
| #!/usr/bin/env bash | |
| # Usage path/to/list-npm-licenses.sh node_modules | |
| function jqq() { | |
| jq -r "$@" 2>/dev/null | |
| } | |
| function grepq() { | |
| grep -q -w "$@" 2>/dev/null |
| let elementsFromPoint = function(x, y) { | |
| let items = []; | |
| let element; | |
| do { | |
| element = document.elementFromPoint(x, y); | |
| if (!element || element === (items[0] || {}).element) { | |
| break; | |
| } | |
| items.unshift({ |