Skip to content

Instantly share code, notes, and snippets.

View daGrevis's full-sized avatar
⌨️
Keyboard operator

Raitis Stengrevics daGrevis

⌨️
Keyboard operator
View GitHub Profile
@daGrevis
daGrevis / counter2.cljs
Created June 29, 2014 10:44
Counter #2 /w ClojureScript and Om
(ns counter.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]))
(enable-console-print!)
(def app-state (atom {:count 2}))
(defn square
([x] (* x x))
### Keybase proof
I hereby claim:
* I am daGrevis on github.
* I am dagrevis (https://keybase.io/dagrevis) on keybase.
* I have a public key whose fingerprint is 2177 F4D9 3FF0 44D7 9C06 B98D C9D2 E5ED 8C4E A01A
To claim this, I am signing this object:
from time import sleep
from sys import argv
from pymouse import PyMouse
try:
seconds = int(argv[1])
except IndexError:
exit("Specify seconds!")
set statusline=
" Path and line number.
set statusline+=%f\:%l
" Modified and readonly flags.
set statusline+=\ %m%r
" Right align.
set statusline+=%=
" Current tag.
set statusline+=%{tagbar#currenttag('[%s]\ ','\ ','f')}
" Filetype.
from multiprocessing import Process
from math import ceil
from time import sleep
from random import random
WORKERS = 4
URLS = [
"amazon.com",
"ebay.com",
CREATE EXTENSION zombodb;
CREATE TABLE "ircMessages" (
"id" uuid PRIMARY KEY,
"serverId" character varying NOT NULL,
"from" character varying NOT NULL,
"to" character varying NOT NULL,
"kind" character varying NOT NULL,
"createdAt" timestamptz NOT NULL,
"text" zdb.fulltext NOT NULL,
FROM postgres:10-alpine
RUN apk add --no-cache git make gcc g++ curl-dev && \
git clone --depth 1 https://github.com/zombodb/zombodb.git && \
cd zombodb && \
make install && \
cd .. && \
rm -rf zombodb && \
apk del git make gcc g++
const postgres = require('../index')
const getMessagesQuery = (serverId, channelName, connectionId) =>
postgres('ircMessages')
.where({ serverId, to: channelName })
.where(function() {
this.where({ isPublic: true })
if (connectionId) {
this.orWhere({ connectionId })
}
snippet if
if (${1}) {
}
endsnippet
snippet sw
switch (${1}) {
case '':
break
default:
@daGrevis
daGrevis / .vimrc
Last active November 20, 2018 10:49
Improved h & l
nnoremap <expr> h col('.') == match(getline('.'), '\S') + 1 ? 'k$' : 'h'
nnoremap <expr> l col('.') == strlen(getline('.')) ? 'j^' : 'l'