Add this line in /etc/profile:
if [ ! `ps -x | grep emacs | grep daemon | awk '{ print $2 }'` ]; then
emacs --daemon 2> /dev/null
fi
Relogin again to start the daemon.
Now you can edit your files with emacsclient command like so:
| #!/usr/bin/env ruby | |
| # - encoding: utf-8 - | |
| # | |
| # E.g. with: pinget.rb https://feeds.pinboard.in/rss/secret:YOURSECRET/u:YOURUSERNAME/toread/ | |
| require 'rss' | |
| require 'open-uri' | |
| require 'uri' | |
| WGET = ['wget', |
| gdisk /dev/sda # make 1 partition | |
| mkfs.vfat -n BOOT /dev/sda1 | |
| mkfs.btrfs -L root /dev/sdb | |
| mkfs.btrfs -L docker /dev/sdc | |
| mount -t btrfs -o noatime,discard,ssd,autodefrag,compress=lzo,space_cache /dev/sdb /mnt/ | |
| btrfs subvolume create /mnt/nixos | |
| umount /mnt/ | |
| mount -t btrfs -o noatime,discard,ssd,autodefrag,compress=lzo,space_cache,subvol=nixos /dev/sdb /mnt/ |
| import exifread | |
| # based on https://gist.github.com/erans/983821 | |
| def _get_if_exist(data, key): | |
| if key in data: | |
| return data[key] | |
| return None |
| all: json2bson | |
| clean: | |
| rm -f json2bson | |
| json2bson: json2bson.c | |
| ${CC} $(shell pkg-config --cflags json libmongo-client glib-2.0) -Wall -O0 -ggdb3 -std=c99 ${CFLAGS} \ | |
| $(shell pkg-config --libs json libmongo-client glib-2.0) -o $@ $^ | |
| check: all | |
| ./json2bson <test.json >test.bson |
| function git_clean_branches | |
| set base_branch develop | |
| # work from our base branch | |
| git checkout $base_branch | |
| # remove local tracking branches where the remote branch is gone | |
| git fetch -p | |
| # find all local branches that have been merged into the base branch |
| [Desktop Entry] | |
| Version=1.0 | |
| Name=org-protocol helper | |
| Comment=helper to allow GNOME to open org-protocol: pseudo-urls | |
| TryExec=/usr/bin/emacsclient | |
| Exec=/usr/bin/emacsclient %u | |
| NoDisplay=true | |
| Icon=emacs24 | |
| Terminal=false | |
| Type=Application |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import subprocess | |
| import tempfile | |
| import requests | |
| import argparse | |
| import textwrap | |
| import sys | |
| #!/usr/bin/env fish | |
| # note: fish at first glance seems much more straightforward to setup with fisher than zsh with zinit | |
| # In particular, fish works with XDG by default, while I wasted a lot of times on env variables | |
| # to get it to work with zsh + zinnit correctly. | |
| # fisher | |
| curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher | |
| # the theme options are many, but these two do async git update |
Add this line in /etc/profile:
if [ ! `ps -x | grep emacs | grep daemon | awk '{ print $2 }'` ]; then
emacs --daemon 2> /dev/null
fi
Relogin again to start the daemon.
Now you can edit your files with emacsclient command like so:
| /// Multi-level sort a slice of Foobars according to [(field, reverse)] | |
| fn sort_by_names(f: &mut [Foobar], orderings: &[(Foofields, bool)]) { | |
| use std::cmp::Ordering; | |
| f.sort_by(|a, b| { | |
| let mut cmp = Ordering::Equal; | |
| for (field, reverse) in orderings { | |
| if cmp != Ordering::Equal { | |
| break; | |
| } |