Skip to content

Instantly share code, notes, and snippets.

View ghisguth's full-sized avatar

Alexander Fedora ghisguth

  • Microsoft
  • Issaquah, WA
View GitHub Profile
signed long my_signed_htonl(signed long value)
{
unsigned long l = *reinterpret_cast<unsigned long *>(&value);
l = htonl(l);
return *reinterpret_cast<signed long *>(&l);
}
signed long my_signed_ntohl(signed long value)
{
unsigned long l = *reinterpret_cast<unsigned long *>(&value);
" .vimrc
set nocompatible
set showcmd
set incsearch
set hlsearch
set novisualbell
set t_vb=
set mouse=a
set mousemodel=popup
set mousehide
#!/usr/bin/env sh
lastversion=`git tag -l | egrep "^v[0-9]+\.[0-9]+\.[0-9]+" | cut -d"-" -f 1 | sed "s/^v//g" | sort | tail -n 1`
if [ -e $lastversion ]
then
lastversion="0.0.0"
else
tmpmajor=`git tag -l | egrep "^v[0-9]+\.[0-9]+\.[0-9]+" | sed "s/^v//g" | cut -d"." -f1 | sort -n | tail -n 1`
tmpminor=`git tag -l | egrep "^v$tmpmajor\.[0-9]+\.[0-9]+" | sed "s/^v//g" | cut -d"." -f2 | sort -n | tail -n 1`
tmpbuild=`git tag -l | egrep "^v$tmpmajor\.$tmpminor\.[0-9]+" | sed "s/^v//g" | cut -d"." -f3 | sort -n | tail -n 1`
#!/usr/bin/env sh
GG_ROOT=$PWD
GGDEB_ROOT=$PWD/build/deb
GGDEB_DEBIAN=$GGDEB_ROOT/DEBIAN
GGDEB_CONTROL=$GGDEB_DEBIAN/control
GGDEB_CONFFILES=$GGDEB_DEBIAN/conffiles
GGDEB_SERVER=$GGDEB_ROOT/opt/server
GGDEB_ETC=$GGDEB_ROOT/etc/seduction
#!/usr/bin/env sh
GG_ROOT=$PWD/info
GGDEB_ROOT=$PWD/deb
GGDEB_DEBIAN=$GGDEB_ROOT/DEBIAN
GGDEB_CONTROL=$GGDEB_DEBIAN/control
GGDEB_SERVER=$GGDEB_ROOT/opt/infoportal
GGDEB_ETC=$GGDEB_ROOT/etc/seduction
if [ -e $GGDEB_OUT ]; then
-- NOTE: Optimized to be fast at simple value indexing.
-- Slower on initialization and on table value fetching.
-- WARNING: This does not protect userdata.
treadonly = nil
do
local newindex = function()
error("attempted to change read-only table")
end
treadonly = function(value, with_tostring, callbacks, disable_nil)
#include <string>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <sys/mman.h>
#include <unistd.h>
int main(int argc, char** argv)
(defun encode(input)
(defun enc(out cur cnt inp)
(defun flush() (cons cnt (cons cur out)))
(cond
((null inp) (if (null cur) out (flush)))
((null cur) (enc out (car inp) 1 (cdr inp)))
((eq cur (car inp)) (enc out cur (+ cnt 1) (cdr inp)))
(t (enc (flush) (car inp) 1 (cdr inp)))))
(nreverse (enc '() '() '() input)))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.