Skip to content

Instantly share code, notes, and snippets.

View pavelz's full-sized avatar

Pavel Zaitsev pavelz

View GitHub Profile
gcc -g -O2 -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c math.c
math.c:37:13: error: missing binary operator before token "("
make: *** [math.o] Error 1
@pavelz
pavelz / gist:2568007
Created May 1, 2012 13:44
basic code to tie select element to display different dom elements
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')
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')
"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
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
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 && \
package loaders
import (
"fmt"
"regexp"
"strconv"
"strings"
_ "github.com/lib/pq"
@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
@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 / inet.go
Last active October 12, 2016 11:31
package models
import (
"fmt"
)
type Inet struct {
Address string
Valid bool
}