Skip to content

Instantly share code, notes, and snippets.

View vendion's full-sized avatar

Adam Jimerson vendion

View GitHub Profile
@vendion
vendion / Clyde output
Created March 2, 2011 02:16
Output from clyde when trying to update from AUR
vendion ~ $ sudo clyde -Syua
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
:: Starting full system upgrade...
:: Identifying AUR packages...
virtualbox-ext-oracle 14/ 14 [############################################] 100%
-> Identified 3 AUR packages.
# -*- Mode: shell-script; sh-basic-offset: 2 -*-
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Justin Davis <jrcd83@gmail.com>
pkgname='clyde-git'
pkgver='20110326'
pkgrel='1'
pkgdesc="Next-generation libalpm/makepkg wrapper."
arch=('i686' 'x86_64')
url="http://clyde.archuser.com"
license=('custom')
vendion ~ $ strace clyde
execve("/usr/bin/clyde", ["clyde"], [/* 53 vars */]) = 0
brk(0) = 0xf59000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f473876a000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
@vendion
vendion / gist:1889179
Created February 23, 2012 02:01
go-sqlite3 compile error
go install -x . 1 ?
WORK=/tmp/go-build287490735
mkdir -p $WORK/github.com/mattn/go-sqlite3/_obj/
cd /home/vendion/gocode/src/github.com/mattn/go-sqlite3
pkg-config --cflags sqlite3
pkg-config --libs sqlite3
$GOROOT/pkg/tool/linux_amd64/cgo -objdir $WORK/github.com/mattn/go-sqlite3/_obj/ -- -I $WORK/github.com/mattn/go-sqlite3/_obj/ sqlite3.go
$GOROOT/pkg/tool/linux_amd64/6c -FVw -I $WORK/github.com/mattn/go-sqlite3/_obj/ -I $GOROOT/pkg/linux_amd64 -o $WORK/github.com/mattn/go-sqlite3/_obj/_cgo_defun.6 -DGOOS_linux -DGOARCH_amd64 $WORK/github.com/mattn/go-sqlite3/_obj/_cgo_defun.c
gcc -I . -g -O2 -fPIC -m64 -pthread -I $WORK/github.com/mattn/go-sqlite3/_obj/ -o $WORK/github.com/mattn/go-sqlite3/_obj/_cgo_main.o -c $WORK/github.com/mattn/go-sqlite3/_obj/_cgo_main.c
gcc -I . -g -O2 -fPIC -m64 -pthread -I $WORK/github.com/mattn/go-sqlite3/_ob
@vendion
vendion / gist:1901836
Created February 24, 2012 16:17
Example code of gosqlite3 erroring if database already exists
package main
import (
"fmt"
"github.com/kuroneko/gosqlite3"
)
func main() {
db, err := sqlite3.Open("test.db") //IF test.db already exists and is valid SQLite3 database this throws error, but the database can be opened with sqlite3 command
if err != nil {
@vendion
vendion / go.vim
Created March 5, 2012 14:45
go.vim syntax checker
"============================================================================
"File: go.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: (please someone else maintain this)
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
@vendion
vendion / second.go
Created April 10, 2012 18:49
Syntastic Go issue
package main
import "fmt"
func displayversion() {
fmt.Println(version)
}
@vendion
vendion / gist:3861237
Created October 9, 2012 20:32
Bootstrap and Go navbar example
{{ define "navbar" }}
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="/">{{ template "title" }}</a>
@vendion
vendion / gist:6442742
Last active December 22, 2015 08:08
Quick example code to take an array of times and randomly grab ten elements from that array. If the source array has less than ten elements, grab all of the elements in a random order.
<?php
// set up array with slides
$slides = array(1, 2, 3, 4, 5);
//$slides = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
//$slides = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
// get ten random array elements to display
$length = count($slides);
### Keybase proof
I hereby claim:
* I am vendion on github.
* I am vendion (https://keybase.io/vendion) on keybase.
* I have a public key whose fingerprint is E910 20F1 E7B3 0F18 E24A 8315 F1F2 6B78 9FC6 42D0
To claim this, I am signing this object: