Skip to content

Instantly share code, notes, and snippets.

@drewwells
drewwells / reflectSlice.go
Last active August 29, 2015 14:18
Examples of reflection with slices
func copySlice(dst interface{}, src interface{}) error {
d := reflect.ValueOf(dst)
if !d.CanAddr() {
d = d.Elem()
} else {
return errors.New("dst must be pointer")
}
s := reflect.ValueOf(src)
c := reflect.MakeSlice(d.Type(), s.Len(), s.Len())
reflect.Copy(c, s)
@drewwells
drewwells / org.golang.doc.example.plist
Created March 26, 2015 16:07
Local godoc server for private packages. You will need to build the search index (periodically) to use search functionality.
?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN
http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>GOPATH</key>
<string>{YOUR GOPATH}</string>
<key>GOROOT</key>
@drewwells
drewwells / SassMeister-input.scss
Created February 23, 2015 14:34
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
%branch { color: brown; }
%leaf { color: green; }
div.branch {
@extend %branch;
.leaf {
@drewwells
drewwells / SassMeister-input.scss
Created February 4, 2015 18:01
Generated by SassMeister.com.
// ----
// Sass (v3.4.11)
// Compass (v1.0.3)
// ----
nav
ul
margin: 0
padding: 0
list-style: none
@drewwells
drewwells / build_log.txt
Created January 22, 2015 16:35
libsass build with Swig on darwin64 against Go 1.4
Applications/Xcode.app/Contents/Developer/usr/bin/make -f ../../Makefile CXXFLAGS='-Wall -std=c++11' SRCDIR='' CSRCS='cencode.c' CXXSRCS='ast.cxx base64vlq.cxx bind.cxx constants.cxx context.cxx contextualize.cxx copy_c_str.cxx cssize.cxx error_handling.cxx eval.cxx expand.cxx extend.cxx file.cxx functions.cxx inspect.cxx node.cxx json.cxx output_compressed.cxx output_nested.cxx parser.cxx position.cxx prelexer.cxx remove_placeholders.cxx sass.cxx sass_util.cxx sass_values.cxx sass_context.cxx sass_functions.cxx sass_interface.cxx sass2scss.cxx source_map.cxx to_c.cxx to_string.cxx units.cxx utf8_string.cxx util.cxx' SWIG='../../../preinst-swig -v' \
TARGET='example' INTERFACE='example.i' go_cpp
../../../preinst-swig -v -go -c++ -intgosize 64 `if false ; then echo -gccgo; fi` -o example_wrap.cxx example.i
Language subdirectory: go
Search paths:
./
./swig_lib/go/
/Users/drew/code/swig/Lib/go/
./swig_lib/
/Users/drew/code/swig/Lib/
@drewwells
drewwells / SassMeister-input-HTML.html
Created December 7, 2014 22:48
Generated by SassMeister.com.
<div>Hello</div>
@drewwells
drewwells / SassMeister-input.scss
Created October 12, 2014 22:05
Generated by SassMeister.com.
// ----
// libsass (v2.0.0)
// ----
@if true {
// Comment
&::#{$defined} {
}
}
@drewwells
drewwells / SassMeister-input.scss
Created October 12, 2014 22:03
Generated by SassMeister.com.
// ----
// libsass (v2.0.0)
// ----
$placeholder: true;
@if $placeholder {
// Comment
&::#{$defined} {
}
}
@drewwells
drewwells / SassMeister-input.scss
Created October 12, 2014 22:00
Generated by SassMeister.com.
// ----
// libsass (v2.0.0)
// ----
@mixin placeholder {
// Comment
&::#{$defined} {
}
}
@include placeholder;
@drewwells
drewwells / SassMeister-input.scss
Created October 7, 2014 03:18
Generated by SassMeister.com.
// ----
// Sass (v3.2.19)
// Compass (v0.12.6)
// ----
// Sass List-Maps 1.0.0
// a libsass polyfill for rubysass "maps" data-type -- using lists
// by @lunelson
// MIT License