Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
// first couple of triangular numbers
// http://en.wikipedia.org/wiki/Triangular_number
const int triag[] = {0, 1, 3, 6, 10, 15, 21};
// returns numbers of elements in first `h` rows of pascal's triangle that are
// not divisible by 7
// http://projecteuler.net/problem=148
long not7(long h) {
" pairs
for mapmode in [ "o", "x" ]
for delimiter in [ "{}", "()", "[]", "<>" ]
let opening = delimiter[0]
let closing = delimiter[1]
for modifier in [ "i", "a" ]
for trigger in [ opening, closing ]
execute mapmode . "noremap <silent> " . modifier . "n" . trigger . " :<C-U>normal! f" . opening . "v" . modifier . closing . "<CR>"
execute mapmode . "noremap <silent> " . modifier . "l" . trigger . " :<C-U>normal! F" . closing . "v" . modifier . opening . "<CR>"
endfor
SOURCES=test.c
EXECUTABLE=test
CC=g++
CFLAGS=-c -Wall
LDFLAGS=
OBJECTS=$(SOURCES:.cpp=.o)
all: $(SOURCES) $(EXECUTABLE)
run: all
# https://wiki.gentoo.org/wiki/Zsh/HOWTO
# TODO: split in separate files like https://github.com/ivyl/zsh-config
autoload -U compinit
compinit
export CORRECT_IGNORE='_*'
source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
java.lang.AssertionError: java.security.NoSuchAlgorithmException: MessageDigest MD5 implementation not found
at org.apache.harmony.xnet.provider.jsse.NativeCrypto.X509_NAME_hash(NativeCrypto.java:188)
at org.apache.harmony.xnet.provider.jsse.NativeCrypto.X509_NAME_hash_old(NativeCrypto.java:181)
at org.apache.harmony.xnet.provider.jsse.TrustedCertificateStore.hash(TrustedCertificateStore.java:417)
at org.apache.harmony.xnet.provider.jsse.TrustedCertificateStore.findCert(TrustedCertificateStore.java:377)
at org.apache.harmony.xnet.provider.jsse.TrustedCertificateStore.isTrustAnchor(TrustedCertificateStore.java:326)
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.findTrustAnchorBySubjectAndPublicKey(TrustManagerImpl.java:307)
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.cleanupCertChainAndFindTrustAnchors(TrustManagerImpl.java:237)
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:184)
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.che
@wellle
wellle / yank.vim
Last active May 10, 2023 02:36
Yank without moving the cursor to the beginning of the yanked text
nnoremap <silent> y :<C-U>call MarkAndSetOpfunc()<CR>g@
vnoremap <silent> y :<C-U>call MarkYankAndJump()<CR>
function! MarkAndSetOpfunc()
let g:save_cursor = getpos(".")
set opfunc=YankAndJumpBack
endfunction
function! MarkYankAndJump()
let g:save_cursor = getpos(".")
@wellle
wellle / group.vim
Last active January 24, 2017 16:52
function! Group()
normal! l"ry$"ly0
redir => message
execute "silent %g/\\V" . escape(@l, '/') . "/d"
redir END
let cnt = matchstr(message, '\d\+')
execute "normal! ggO" . cnt . ' ' . @l . ' || ' . @r . "\<Esc>0"
endfunction
nnoremap <silent> <leader>g :call Group()<CR>
@wellle
wellle / gist:9247763
Created February 27, 2014 10:31
gbd settings (try for debugging tmux)
# We have scroll bars in the year 2012!
set pagination off
# Attach to both parent and child on fork
set detach-on-fork off
# Stop/resume all processes
set schedule-multiple on
@wellle
wellle / append.vim
Last active March 17, 2023 13:02
Commands to append after (and insert before) any text object. http://redd.it/1z93ww
nnoremap <silent> <Leader>a :set opfunc=Append<CR>g@
nnoremap <silent> <Leader>i :set opfunc=Insert<CR>g@
function! Append(type, ...)
call feedkeys("`]a", 'n')
endfunction
function! Insert(type, ...)
call feedkeys("`[i", 'n')
endfunction
#!/usr/bin/env php
<?php
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |