This file contains 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 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 |
This file contains 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 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) |
This file contains 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 strutils, os | |
proc simplifyPath(path: string): string = | |
var segments: seq[string] = @[] | |
var i = 0 | |
var curDir = "" | |
while true: | |
case path[i] | |
of dirSep, altSep: |
This file contains 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 macros, strutils | |
type | |
TokenKind = enum | |
FInt, FString, Text | |
Token = object | |
case kind: TokenKind | |
of FInt, FString: nil | |
of Text: c: String |
This file contains 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 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") |
This file contains 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 | |
asyncdispatch, asyncnet, htmlparser, xmltree, httpclient, strutils, | |
strtabs, streams, uri, sets | |
var visited = initSet[string]() | |
proc crawl(url: string, client: PAsyncHttpClient = newAsyncHttpClient()) {.async.} = | |
if url in visited: return # Already visited this URL. | |
echo("Crawling ", url) | |
visited.incl(url) |
This file contains 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
<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 |
This file contains 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 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): |
This file contains 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
[Package] | |
name = "kwin-tiling" | |
version = "0.1.0" | |
author = "Simon Hafner" | |
description = "Tiling for the KWin window manager." | |
license = "GPLv2" | |
bin = "tiling" | |
backend = "js" |
This file contains 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
# Compile with nimrod c -d:release --threads:on PN.nim | |
import os, strutils, unsigned | |
const | |
TileDim = 50 | |
Miw = 2 | |
MaxWid = 8 | |
NumLevs = 800 |