Skip to content

Instantly share code, notes, and snippets.

View xyproto's full-sized avatar
😊

Alexander F. Rødseth xyproto

😊
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
const int seed[2][2] = {{0, 2}, {3, 1}};
int main(int argc, char *argv[])
{
unsigned x, y, m = 3;
if (argc == 2)
m = atoi(argv[1]);
func jedi() {
fmt.Print("For eight hundred years have I ")
fmt.Print("trained Jedi.\nMy own counsel ")
fmt.Print("will I keep on who is to be ")
fmt.Print("trained.\nA Jedi must have the ")
fmt.Print("deepest commitment,\nthe most ")
fmt.Print("serious mind.")
}
func yoda() {
@xyproto
xyproto / jEdit property file
Created August 15, 2013 09:37
Port of the "tolerable" color scheme from gvim/vim to jEdit
#jEdit properties
#Thu Aug 15 11:27:08 CEST 2013
buffer.indentSize=4
view.gutter.highlightColor=\#660000
view.height=1180
vfs.browser.type.width=100
view.status.show-caret-virtual=true
view.selectionFg=false
view.status.foreground=\#000000
view.gutter.highlightInterval=10
@xyproto
xyproto / main.go
Created June 24, 2015 10:14
gzip compression/decompression example
package main
import (
"fmt"
"compress/gzip"
"io"
"io/ioutil"
"bytes"
"log"
)
@xyproto
xyproto / dui.c
Created October 15, 2015 09:34
Small utility for removing unversioned items in a svn repository
/*
* Delete unversioned items
*
* Small utility that really should have been a script instead.
* It has worked fine for five years, though.
* Works on both Linux and Windows.
*
* Alexander F Rødseth <xyproto@archlinux.org>, 2015-10-15
*
* Public Domain
@xyproto
xyproto / boltdatabase.go
Last active November 6, 2015 11:20
Example for creating a Bolt database with a specific filename, and retrieving the Bolt database struct
package main
import (
"fmt"
"github.com/boltdb/bolt"
"github.com/xyproto/permissionbolt"
)
func main() {
filename := "bolt.db"
package main
import (
"fmt"
"log"
"encoding/json"
)
func main() {
mapSI := map[string]int{"x": 2}
@xyproto
xyproto / main.pony
Created December 3, 2015 19:59
dibs in Pony
actor Main
new create(env: Env) =>
env.out.print("dibs!")
@xyproto
xyproto / test_otto.sh
Last active July 28, 2016 09:26
Test changes to otto for EcmaScript 5 compliance improvements
#!/bin/sh
git clone https://github.com/robertkrimen/otto
cd otto/otto; go get -d; go build; cd ../..
git clone https://github.com/tc39/test262.git
git clone https://github.com/test262-utils/test262-harness-py.git
python2 test262-harness-py/src/test262.py --command otto/otto/otto --tests test262 > original.log
rm -rf otto
git clone https://github.com/xyproto/otto.git
cd otto/otto; go get -d; go build; cd ../..
python2 test262-harness-py/src/test262.py --command otto/otto/otto --tests test262 > xyproto.log