Skip to content

Instantly share code, notes, and snippets.

View be5invis's full-sized avatar

Belleve be5invis

View GitHub Profile
@be5invis
be5invis / guess.moe
Created March 14, 2012 14:10
An solution of Vczh's problem
var MakeTest(a0, d):
var j = 0;
return (x) =>
def r = a0 + d * j;
j += 1;
return x === r
def guess(test):
var counter = 0
for var segment in 1..infinity:
@be5invis
be5invis / answer.c
Created November 25, 2010 11:48
An answer for a (fake)loli.
#define digit(p) ('0' <= *(p) && *(p) <= '9')
char* a[1000];
int n = 0;
void fetch(char* p){
while(*p && !digit(p)) p++;
if(*p){
char* start = p;
while(*p && digit(p)) p++;
a[n] = start; n++;
if(*p) *p = 0, fetch(++p);
@be5invis
be5invis / gist:651379
Created October 28, 2010 13:47
A Better <home> key for windows users
function HomeBind(offset)
let cursor=getpos('.')
let s0=getline(line('.'))
let s1=substitute(s0, "^\\s\\+", "", "")
let x=len(s0)-len(s1)+1
if col('.') == x-a:offset
let x=1
endif
call setpos('.', [cursor[0], cursor[1], x, cursor[3]])
endfunction