Skip to content

Instantly share code, notes, and snippets.

baabelfish

Block or report user

Report or block baabelfish

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View oiawje.nim
import
future,
tables
proc delete_if[X, Y](t: var Table[X, Y], fn: (k: X, v: Y) -> bool) =
for k, v in t:
if fn(k, v):
t.del k
View conceptsandtraits.nim
import math
{.this: self.}
# Module myprojectconcepts
type
HasArea = concept c
c.area() is float64
HasPointlessArea = concept c
View funcs.nim
import
macros,
typetraits,
typeinfo,
future,
unittest
# Currying
template curry*[T1, T2, R](f: (T1, T2) -> R, t1: T1): (T2) -> R = (t2: T2) => f(t1, t2)
View serenitywat.log
Nice to see that private SerenityServers with password protection work.
"Console<0><Console><Console>" say "[Mansikki] Hello AvisHunden Vape4forChrilleNLEIF! Shout !help for help."
"AvisHunden Vape4forChrilleNLEIF<45><STEAM_1:0:138775353><Unassigned>" triggered "clantag" (value "VelocityC")
"AvisHunden Vape4forChrilleNLEIF<45><STEAM_1:0:138775353>" switched from team <Unassigned> to <TERRORIST>
"AvisHunden Vape4forChrilleNLEIF<45><STEAM_1:0:138775353>" switched from team <Unassigned> to <TERRORIST>
Team "CT" triggered "SFUI_Notice_CTs_Win" (CT "1") (T "0")
Team "CT" triggered "SFUI_Notice_CTs_Win" (CT "1") (T "0")
Team "CT" scored "1" with "1" players
@baabelfish
baabelfish / 1_nim_completer.py
Last active Aug 29, 2015
YCM completer for nim that supports GoTo, GetType and autocomplete
View 1_nim_completer.py
import subprocess
import os
from ycmd.utils import ToUtf8IfNeeded
from ycmd.completers.completer import Completer
from ycmd import responses, utils
NIM_COMPILER = '/usr/bin/nim'
TokenTypeMap = {
@baabelfish
baabelfish / cookieclicker.js
Last active Aug 29, 2015
Cooki clicker stuff
View cookieclicker.js
var Cookie = {
data: {
buyers: {}
},
startClicking: function(id) {
Cookie.data.clickId = window.setInterval(function() {
document.getElementById('bigCookie').click();
}, 1);
console.log('Clicking!');
},
View noheap.cpp
// http://www.barrgroup.com/Embedded-Systems/How-To/Polymorphism-No-Heap-Memory
// clang++ -O3 --std=c++1y noheap.cpp -o noheap && ./noheap
// Stack version is 2-3x faster
#include <memory>
#include <chrono>
#include <cassert>
#include <iostream>
#include <array>
#include <random>
View tuplemeta.cpp
#include <tuple>
#include <iostream>
#include <limits>
#include <utility>
namespace mtl {
namespace internal {
static constexpr size_t Max = std::numeric_limits<size_t>::max();
View interface.cpp
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
#define GLUE(x, y) x##y
#define GETSET(_v, ...)\
private:\
__VA_ARGS__ GLUE(m_, _v);\
public:\
You can’t perform that action at this time.