Skip to content

Instantly share code, notes, and snippets.

@liamzdenek
liamzdenek / example.js
Created November 4, 2018 23:29
Trigger an asynchronous action from an observable, and wait for it to complete before emitting another action.
function someEpic(action$, state$) {
return action$.ofType(SOME_BEGIN).pipe(
flatMap(begin => {
return merge(
of(actionCreatorForAsync()),
action$.ofType(ASYNC_END).pipe(
map(reduxRouterPush("/"))
)
)
})
package main
import (
"log"
"github.com/liamzdenek/go-pthreads"
)
func createThread(num int, url string) {
defer func() {
package main
import (
"log"
"github.com/liamzdenek/go-pthreads"
)
func createThread(num int, url string) {
defer func() {
@liamzdenek
liamzdenek / render.js
Created May 12, 2016 18:45
Render Left Join into HTML using JS
function render_rows(rows) {
// html is a variable that contains a html string that we're going to build dynamically
var html = "",
// cur_msg_id keeps track of which message_id we are currently printing the comments of
cur_msg_id = 0;
// begin a loop over each row within the table
for(i = 0; i < rows.length; i++) {
// store the message id of this row for later use
cur_msg_id = rows[i]['message_id'];
@liamzdenek
liamzdenek / index.html
Created May 12, 2016 18:38
Flask template with Left Join
{% set cur_msg_id = -1 %}
{% for row in rows %}
{% if cur_msg_id != row['message_id'] %}
{% set cur_msg_id = row['message_id'] %}
Message: {{ row['message_id'] }}<br/>
{% endif %}
{% if row['comment_id'] != None %}
{{ row['first_name'] }} {{ row['last_name'] }}: {{ row['comment'] }}<br/>
{% endif %}
{% endfor %}

Keybase proof

I hereby claim:

  • I am LiamZdenek on github.
  • I am lz (https://keybase.io/lz) on keybase.
  • I have a public key whose fingerprint is C015 339B 7814 ABD4 CA59 4D3F 2C2F 5347 A175 CAFB

To claim this, I am signing this object:

@liamzdenek
liamzdenek / Makefile
Last active December 24, 2015 02:49
Attempt at using shared objects with Go
default:
gccgo -g -O0 -fPIC -shared shared.go -o libshared.so -lgcc
go build loader.go
@liamzdenek
liamzdenek / gist:4047303
Created November 9, 2012 18:18
product-packing markup
<?
$boxes = array(
array(
length => 10, // IN
width => 10,
height => 10,
cost => 4, // USD
),
array(
length => 12,
@liamzdenek
liamzdenek / gist:4039581
Created November 8, 2012 15:45
DF mini-fortress mockup
D = door
+-| = walls
X = up/down stair
> = down stair
< = up stair
W = workshop space
P = storage plots
B = bed
C = cabinet
F = farm plot
{
"baseCommandAliases": [
"f"
],
"allowNoSlashCommand": true,
"colorMember": "GREEN",
"colorAlly": "LIGHT_PURPLE",
"colorNeutral": "WHITE",
"colorEnemy": "RED",
"colorPeaceful": "GOLD",