Alex Agranov alexagranov
-
Morphogenic
- Brooklyn, NY
- Sign in to view email
- www.morphogenic.net
View Preferences.el
;; ~/Library/Preferences/Aquamacs Emacs/Preferences.el | |
;; This is the Aquamacs Preferences file. | |
;; Add Emacs-Lisp code here that should be executed whenever | |
;; you start Aquamacs Emacs. If errors occur, Aquamacs will stop | |
;; evaluating this file and print errors in the *Messags* buffer. | |
;; Use this file in place of ~/.emacs (which is loaded as well.) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. |
View .dir-locals.el
((web-mode . ((web-mode-code-indent-offset . 2) | |
(web-mode-css-indent-offset . 2) | |
(web-mode-markup-indent-offset . 2)))) |
View bespoke_flatten.rb
# frozen_string_literal: true | |
require 'test/unit' | |
class BespokeFlattenTest < Test::Unit::TestCase | |
def bespoke_flatten(arr, accum = []) | |
return arr unless arr.is_a?(Array) | |
until arr.empty? | |
elem = arr.shift | |
elem.is_a?(Array) ? bespoke_flatten(elem, accum) : (accum << elem) |
View count_tabs.pl
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use v5.18; | |
my $MAX_TABS = 22; | |
while (<STDIN>) { | |
chomp $_; | |
my $c = ($_ =~ tr/\t//); |
View git_lfs.rb
# .git_hooks/pre_push/git_lfs.rb | |
# Be sure to enable this hook in .overcommit.yml like this: | |
# | |
# PrePush: | |
# GitLfs: | |
# enabled: true | |
module Overcommit::Hook::PrePush | |
class GitLfs < Base |
View web.el
;;; package -- Summary: | |
;;; Commentary: | |
;;; Hooks for web mode | |
;;; Code: | |
(require 'web-mode) |
View .bash_aliases
#!/bin/bash | |
alias ll='ls -al' | |
alias gimmeawindow="xterm -b 4 -sb -sl 5000 -geometry 110x60 -vb -fg yellow -bg black -fa \'Consolas\' -fs 16 &" | |
alias strace='dtruss' | |
alias start_postgres='pg_ctl -D /usr/local/var/postgres -l /var/log/postgres.log start' | |
alias stop_postgres='pg_ctl -D /usr/local/var/postgres stop -m fast' | |
alias ssh_to_master_db='ssh -o TCPKeepAlive=yes -o ServerAliveInterval=300 -L 5452:localhost:5432 root@master-db -p 22' |
View gist:d7ac066eda99f9e485ea
# check the window size after each command and, if necessary, | |
# update the values of LINES and COLUMNS. | |
shopt -s checkwinsize | |
# make less more friendly for non-text input files, see lesspipe(1) | |
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" | |
# set variable identifying the chroot you work in (used in the prompt below) | |
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then | |
debian_chroot=$(cat /etc/debian_chroot) |
View gist:1e84c17e1210e4e062af
sudo cpan Regexp::Debugger | |
vi /tmp/t.pl | |
`'abc' =~ /abx|c/` | |
perl -MRegexp::Debugger /tmp/t.pl | |
or | |
rxrx /tmp/t.pl |
View .emacs
(require 'tls) | |
(push "/usr/local/etc/libressl/cert.pem" gnutls-trustfiles) | |
;; ____________________________________________________________________________ | |
;; Aquamacs custom-file warning: | |
;; Warning: After loading this .emacs file, Aquamacs will also load | |
;; customizations from `custom-file' (customizations.el). Any settings there | |
;; will override those made here. | |
;; Consider moving your startup settings to the Preferences.el file, which | |
;; is loaded after `custom-file': |
NewerOlder