Skip to content

Instantly share code, notes, and snippets.

View Philonous's full-sized avatar

Philipp Balzarek Philonous

View GitHub Profile
#2.Managing the Roster
472SHOULDNA
473MUSTNA
477MUSTNA
#2.1.1.Ver Attribute
514MUSTDONE
515MUSTDONE
519RECOMMENDEDDONE
#2.1.2.1.Approved Attribute
543SHOULDNA
#1.2.Terminology
180MUSTNA
180MUST NOTNA
180REQUIREDNA
180SHALLNA
180SHALL NOTNA
181SHOULDNA
181SHOULD NOTNA
181RECOMMENDEDNA
181NOT RECOMMENDEDNA
(defun requirements-goto-field (n)
"go to beginning of nth field"
(beginning-of-line)
(dotimes (i n)
(search-forward "|" (line-end-position) t)
(if (= (point) (line-end-position))
(return nil))))
(defun requirements-field-end ()
"find end of field"
@Philonous
Philonous / DBLayout.hs
Created April 16, 2014 11:07
DB layout
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module DBLayout where
#/bin/sh
DOWNLOAD="wget -c --trust-server-names --max-redirect=3"
if [ ! -d mods ]; then
mkdir mods
fi
cd mods
@Philonous
Philonous / haskell-add-import-line.el
Last active August 29, 2015 14:01
haskell-add-import-line
(defvar module-abbrevs nil)
(setq module-abbrevs '(("Text"
"Data.Text (Text)"
"qualified Data.Text as Text")
("Encoding" "qualified Data.Text.Encoding as Text")
("Map" "qualified Data.Map as Map"
"Data.Map (Map)"
)
("Set" "Data.Set (Set)"
"qualified Data.Set as Set")
@Philonous
Philonous / qualify.el
Created May 26, 2014 17:37
haskell-qualify-import-line
(defun haskell-qualify-import-line (&optional no-toggle)
"Toggle \"qualified\" modifier of current import line"
(interactive "P")
(require 'haskell-align-imports)
(save-excursion
(beginning-of-line)
(cond
((looking-at "import qualified\\([ ]?\\)[ ]*")
(unless no-toggle
(replace-match "import\\1")

Type definitions

TYPE JID = Simple

  • String

TYPE Boolean = Simple

UInt8
1 represents true, 0 represents false

TYPE MaybeError = Struct

UInt 8
0 success, 1 on error
String
Error Message on error or empty string otherwise
(defun underscore-to-camelcase ()
"Convert underscores to camelCase"
(interactive)
(destructuring-bind (beg . end) (bounds-of-thing-at-point 'word)
(goto-char beg)
(while (re-search-forward "_\\([a-z]\\)" end t)
(replace-match (upcase (match-string 1))))))
(defun camelcase-to-underscore ()
"Convert underscores to camelCase"
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"><node name="/"><node name="pontarius/service"><interface name="pontarius.service"><method name="markKeyVerified"><arg name="location" type="s" direction="in"/></method><method name="markKeyVerified"><arg name="key-id" type="s" direction="in"/><arg name="identity" type="s" direction="in"/></method><method name="revokeKey"><arg name="key-id" type="s" direction="in"/><arg name="reason" type="s" direction="in"/></method><method name="initiateChallenge"><arg name="peer" type="s" direction="in"/><arg name="question" type="s" direction="in"/><arg name="secret" type="s" direction="in"/><arg name="challenge_id" type="s" direction="out"/></method><method name="respondChallenge"><arg name="challenge_id" type="s" direction="in"/><arg name="secret" type="s" direction="in"/><arg name="succeeded" type="s" direction="out"/></method><method name="ge