Skip to content

Instantly share code, notes, and snippets.

View pavelz's full-sized avatar

Pavel Zaitsev pavelz

View GitHub Profile
// Header home
.header-site
@extends $bg
li
margin 0
list-style-type none
.person
img
size(130, 130)
border-radius 100%
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package template
import (
"bytes"
"fmt"
"strings"
@pavelz
pavelz / inet.go
Last active October 12, 2016 11:31
package models
import (
"fmt"
)
type Inet struct {
Address string
Valid bool
}
@pavelz
pavelz / surfingkeys.exclude
Created September 20, 2016 08:53
exclude these sites from surfing keys. press 'se' to edit configuration
settings.blacklist = {
"https://github.com": 1,
"https://trello.com": 1,
"https://mail.google.com": 1,
"https://gmail.com": 1
};
@pavelz
pavelz / install_gnu.sh
Last active September 19, 2016 10:46
shell script to install all GNU goodness over OS X BSD crud
#!/bin/bash
set -e
brew install binutils
brew install homebrew/dupes/diffutils
brew install ed --with-default-names
brew install findutils --with-default-names
brew install gawk
brew install gnu-indent --with-default-names
package loaders
import (
"fmt"
"regexp"
"strconv"
"strings"
_ "github.com/lib/pq"
FROM boot2docker/boot2docker
RUN apt-get -y install p7zip-full
ENV VBOX_VERSION 4.3.12
# Build VBox guest additions
RUN mkdir -p /vboxguest && \
cd /vboxguest && \
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/${VBOX_VERSION}/VBoxGuestAdditions_${VBOX_VERSION}.iso && \
Last login: Fri May 23 01:35:21 on ttys001
➜ ~ pg_ctl -D /usr/local/var/postgres -m f stop
waiting for server to shut down......................................^C
➜ ~ which pg_ctl
/usr/local/bin/pg_ctl
➜ ~ which pg_ctl -V
/usr/local/bin/pg_ctl
-V not found
➜ ~ which pg_ctl -v
/usr/local/bin/pg_ctl
"remap the searching commands to my new function. The function is called first, then immediately calls itself
"after the search is finished. This allows me to get the advantage of incsearch being unimpeded by anything
noremap <space> :call DoSearch('search')<Cr>/
noremap n :call DoSearch('search')<Cr>n
noremap N :call DoSearch('search')<Cr>N
noremap * :call DoSearch('search')<Cr>*
noremap # :call DoSearch('search')<Cr>#
noremap ? :call DoSearch('search')<Cr>?
"DoSearch takes a 'command' that specifies whether it needs to call itself again after exeution
jQuery ->
$(document).ready ->
element = $('#item_type')
element.bind 'change', ->
el = $('#item_type')[0]
$('.type_edit').css('display','none')
$('.' + el.options[el.selectedIndex].text.toLowerCase()).css('display','block')