Skip to content

Instantly share code, notes, and snippets.

View danlamanna's full-sized avatar
🏠

Dan LaManna danlamanna

🏠
View GitHub Profile
- name: symlink dotfiles
file:
src=/home/dan/{{ item.src }}
dest=/home/dan/{{ item.dest }}
owner=dan
group=dan
state=link
with_items:
- { src: "dotfiles/.bashrc", dest: ".bashrc" }
- { src: "dotfiles/.tmux.conf", dest: ".tmux.conf" }
- name: install base packages
apt: name={{ item }} state=present
with_items:
- ack-grep
- artha
- chromium
- cmake
- curl
- ecryptfs-utils
- filezilla
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <ftw.h>
#include <errno.h>
#include <hiredis/hiredis.h>
#include <openssl/md5.h>
#!/bin/bash
RSYNC=$(which rsync)
# how to backup vms?
RSYNC_FLAGS=" -ahvP --delete --exclude=/archives/cloud_backup\* --exclude=/vms/ --exclude=/research/data/ "
SRC=/media/ronon/
DEST="athos:/STORAGE/lantea_ronon/"
(defun sudo-tramp-current-file()
(interactive)
(when buffer-file-name
(let ((pos (point)))
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))
(goto-char pos))))
sudo apt-get install --download-only virtualbox eclipse synergy transmission-gtk chromium icedove pidgin artha filezilla mlocate python-pip python-dev htop vlc libx11-dev libmpc-dev autoconf automake libtool texinfo xorg-dev libgtk2.0-dev libjpeg-dev libgif-dev libtiff-dev libm17n-dev libpng12-dev librsvg2-dev libotf-dev libncurses-dev
import networkx as nx
from matplotlib import pylab
import matplotlib.pyplot as plt
with open("/home/dan/files/research/wtp/sna/10per_confidence_edges.txt", "r") as infile:
rules = []
for line in infile:
rules.append(line.strip().split())
class emacs {
$deps = [ "git",
"autoconf",
"automake",
"libtool",
"texinfo",
"build-essential",
"xorg-dev",
"libgtk2.0-dev",

All these operations are very natural for buffer objects as well as strings, which leads me to the conclusion we should provide two flavours for each function, for buffers and for strings. The way emacs does it is by specifying an object argument. I find this suboptimal, but it is also possible solution (and would reduce the number of functions in half). Note that there are also different indexing conventions, see the Question below.

All functions come in buffer and string flavours. The “current position” is called point in buffer versions and offset in string

$cur_month = date("M Y");
$next_month = date("M Y", strtotime("next month"));
# BG already happened this month, need to get next months time..
if (strtotime("now") > ($bg_time = strtotime("+3 week tuesday $cur_month"))) {
$bg_time = strtotime("+3 week tuesday $next_month");
}
printf("Our next event will be at %s", date("M-d-Y", $bg_time));