This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instead of | |
let im_session = createMockSession(); | |
im_session = im_session.setIn(["person", "id"], personId); | |
// It is also possible to write | |
const im_session = createMockSession() | |
.setIn(["person", "id"], personId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#define RT_assert(ignored) | |
#define RT_die(ignored) exit(1) | |
int | |
get_next_utf_8_codepoint(const char **str) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gist: https://goo.gl/23tBjT | |
const { | |
$, mount, loop, cond, | |
dom, h1, p, button, div | |
} = require("zodiac"); | |
function Button({text, $click}) { | |
return button({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tupfile: | |
: helloworld.c |> cl -c helloworld.c |> helloworld.obj | |
helloworld.c: | |
#include<stdio.h> | |
int main() | |
{ | |
printf("Hello world"); | |
return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gist: https://goo.gl/23tBjT | |
const { | |
$, mount, loop, | |
dom, h1, p, button, div, | |
} = require("zodiac"); | |
function Button({text, $click}) { | |
return button( | |
{ $click, type: "button" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following code produces a segfault from within gc.nim (see bottom) | |
# The segfault does not occur when using --gc:markAndSweep | |
type | |
TNode = tuple | |
prev: ptr TNode | |
var | |
front = cast[ptr TNode](alloc0(sizeof(TNode))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
TChunkyNode[IX, T] = tuple | |
elms: array[IX, T] | |
next: PChunkyNode[IX, T] | |
PChunkyNode[IX, T] = ptr TChunkyNode[IX, T] | |
TChunkyArray*[IX, T] = object | |
first: PChunkyNode[IX, T] | |
size: int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template a(payload: stmt) = | |
payload | |
a: | |
a: # (a is a normal template) | |
a: | |
a: | |
a: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import queues | |
type | |
TWidget = object | |
names: TQueue[string] | |
var w = TWidget(names: initQueue[string]()) | |
add(w.names, "Paddington") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Functions | |
double n = n * 2 | |
double_upto_hundred n = if double n > 100 | |
then n | |
else double_upto_hundred (double n) |
NewerOlder