Skip to content

Instantly share code, notes, and snippets.

(define l_y1 :: int)
(define l_y2 :: int)
(define l_y3 :: int)
(define l_x1 :: int)
(define l_x2 :: int)
(define l_x3 :: int)
(define l_x4 :: int)
(assert (<= l_x1 3))
(assert (>= l_x1 0))
@sphynx
sphynx / gist:813324
Created February 6, 2011 12:01
SSH agent setup in .bashrc
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initializing new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
;; Packages.
(require 'package)
(add-to-list 'package-archives
(cons "melpa-stable" "http://stable.melpa.org/packages/") t)
(package-initialize)
(add-to-list 'load-path "~/elisp") ;; for saving some custom code.
;; Save customizations in a separate file.
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
;; Packages.
(require 'package)
(add-to-list 'package-archives
(cons "melpa-stable" "http://stable.melpa.org/packages/") t)
(package-initialize)
(add-to-list 'load-path "~/elisp") ;; for saving some custom code.
;; Save customizations in a separate file.
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
@sphynx
sphynx / serial.c
Last active December 18, 2018 23:21
Example of functions inside global structures, emulating "Serial" from Arduino language.
#include <stdio.h>
#include <stdlib.h>
typedef void (*func) (const char *);
struct module {
func print;
func println;
};