Skip to content

Instantly share code, notes, and snippets.

View dom96's full-sized avatar
🛤️

Dominik Picheta dom96

🛤️
View GitHub Profile
import macros
macro `=>`(p, b: expr): expr {.immediate.} =
echo treeRepr(p)
#echo(treeRepr(b))
var params: seq[PNimrodNode] = @[newIdentNode("auto")]
case p.kind
of nnkPar:
for c in children(p):
<carols> =====BEGIN GSOC 2014 ORG REJECTION FEEDBACK MEETING====
<carols> hi everyone, thanks for coming
<carols> this year we got 371 (well, technically 372) applications from organizations for the program.
<carols> we accepted 190 organizations in total
<carols> but unfortunately, we always have less space for orgs than we have applications.
<carols> this year we emphasized, as we have in the past, accepting organizations that have never participated before and/or were small communities
* bakercp is now known as openFrameworks_b
<carols> we again saw a huge amount of applications from folks in the bioinformatics, life sciences, and biology fields
* 64MAAD0I7 is now known as kshitij
<carols> but we also got some great new applications from fields we've never had participate before
import asyncnet, asyncdispatch
var clients: seq[PAsyncSocket] = @[]
proc processClient(client: PAsyncSocket) {.async.} =
while true:
let line = await client.recvLine()
for c in clients:
await c.send(line & "\c\L")
import strutils, os
proc simplifyPath(path: string): string =
var segments: seq[string] = @[]
var i = 0
var curDir = ""
while true:
case path[i]
of dirSep, altSep:
import asynchttpserver, httpclient, parseurl, asyncdispatch, strtabs, strutils
var server = newAsyncHttpServer()
proc onRequest(req: TRequest) {.async.} =
var client = newAsyncHttpClient()
var htmlResp = ""
try:
let reqResp = await client.get(req.url.path)
import asyncdispatch, httpclient, os, strutils
# ~/nimbb/nim/bin/nim c --threadAnalysis:off -d:ssl -r tcrawl3.nim 10 300 500
var numRunning = 0
var good = 0
var bad = 0
# not used....
var concurrency = 3
@dom96
dom96 / game.nim
Last active August 29, 2015 14:12
import strutils
import lib
type
UpperScene = object of Scene
LowerScene = object of Scene
proc newUpperScene(): ref UpperScene =
result = new UpperScene
import os, asyncnet, asyncdispatch
type
CBOnClientMessage* = proc(message: string)
proc handleClient(sockClient: AsyncSocket, cb: CBOnClientMessage) {.async.} =
while true:
let line = await sockClient.recvLine()
if "" == line:
break
import asyncnet, asyncdispatch, strtabs, parseutils, sha1, jester, htmlgen
type
WebSocketCallback = proc (client: WebSocket, message: WebSocketMessage) {.closure, gcsafe.}
WebSocketRecvClosure = proc (ws: WebSocket): Future[string] {.gcsafe, closure.}
WebSocketMessage = ref object
msg: string
var surf = newScreenSurface(800, 600)
var r: TRect = (0, 0, 900, 900)
# Draw the shapes
surf.fillRect(r, colWhite)
surf.drawLineAA((100, 170), (400, 471), colTan)
surf.drawLine((100, 170), (400, 471), colRed)
surf.drawEllipse(200, 300, 200, 30, colSeaGreen)
surf.drawHorLine(1, 300, 400, colViolet)