Skip to content

Instantly share code, notes, and snippets.

@refaqtor
refaqtor / import-github-issues.sh
Created November 28, 2021 03:48 — forked from dradtke/import-github-issues.sh
A script for importing GitHub issues into a Fossil repository
#!/bin/bash
# +o histexpand is to avoid issues with ! showing up in ticket descriptions.
# The rest are just good Bash script practice.
set -eu -o pipefail +o histexpand
if [[ $# -lt 2 ]]; then
echo "usage: $0 <user> <repo>"
exit 1
fi
@refaqtor
refaqtor / facts.lua
Created April 11, 2021 01:19 — forked from randrews/facts.lua
Make Lua look like Prolog!
----------------------------------------------------------------------------------------------------
--- Making Lua look like Prolog:
---
--- Let's use metatables for something other than emulating prototype-based OO. By making the
--- __index metamethod create values for undefined things, we can make Lua look like Prolog!
--- We create empty tables for anything starting with a capital letter, functions that populate
--- those tables for lowercase things (to assign relationships) and if a name begins with "is_"
--- then it becomes a function that queries those tables.
----------------------------------------------------------------------------------------------------
import
intsets,
tables
type
GraphNode*[T] = ref GraphNodeObj[T]
GraphNodeObj[T] = object
val: T
adj: IntSet
nodesIn: int
@refaqtor
refaqtor / SIMPL_MSP430_8
Created April 17, 2018 04:02 — forked from anonymous/SIMPL_MSP430_8
A version of SIMPL to run on the MSP430G2553 Launchpad
// SIMPL Interpreter for MSP430 Launchpad - inspired by an original idea by Ward Cunningham
// A minimal 868 byte Txtzyme for MSP430 Launchpad with MSP430G2533
// Add in SIMPL framework - to allow construction and use of user defined words - increases to 1084 bytes
#define RXD BIT1 // Receive Data (RXD) at P1.1
#define TXD BIT2 // Transmit Data (TXD) at P1.2
#define RED 0x20 // Red LED is on Bit 6
#define GREEN 0x01 // Green LED is on Bit 0
@refaqtor
refaqtor / fossetup.sh
Created January 7, 2018 23:10 — forked from dehylton/fossetup.sh
/bin/sh script for setting up projects in fossil
#!/bin/sh
#set -vx
## 2016 / dewey hylton
## wrapper to create/modify fossil repositories
## handles with default documentation, users, etc.
DATADIR="./fossils"
DATADIR="./fossil"
READMEDIR="docs"
READMEMD="${READMEDIR}/README.md"
@refaqtor
refaqtor / ngrxintro.md
Created January 6, 2017 19:27 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@refaqtor
refaqtor / gist:050922ecf802081477ecfd978da5c9bc
Created October 26, 2016 01:48 — forked from stran12/gist:1394757
Step-by-step installation of cGit with Nginx

How to install cGit on Nginx (Ubuntu server)

Step-by-step installtion of cGit on nginx without funky rewrite rules.

Pre-requisites

This is for

/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>
@refaqtor
refaqtor / NavigationDrawer.qml
Created May 21, 2016 14:28 — forked from jbache/NavigationDrawer.qml
Qt Quick Navigation Drawer
/*
Copyright (c) 2014 Cutehacks A/S
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions: