This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/davecgh/go-spew/spew" | |
"github.com/skelterjohn/gopp" | |
"os" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# save as foobar.sh, chmod 755 foobar.sh, ./foobar.sh and see what happens. | |
echo 1 ; line=`tail -1 $0` ; num=`echo $line | awk '{ print $2 + 1 }'` ; echo $line | sed "s/^echo [0-9]* ;/echo $num ;/" >> $0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Makefile b/Makefile | |
index eb976b5..97c4d79 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -22,12 +22,12 @@ include Makefile.cfg | |
export CC = gcc -pthread | |
export CFLAGS += -I. -Wall -Os -ggdb -D_GNU_SOURCE -fPIC | |
-export LDLIBS += -lncursesw | |
+export LDLIBS += $(LDFLAGS) -lncursesw -liconv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Newsbeuter <Formula | |
url 'http://www.newsbeuter.org/downloads/newsbeuter-2.4.tar.gz' | |
homepage 'http://www.newsbeuter.org/' | |
md5 '67fd0d44a55e10ed1ba15b197262a35f' | |
depends_on 'stfl' | |
depends_on 'curl' | |
depends_on 'sqlite' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Car struct { | |
Vehicle | |
} | |
func(c *Car) Accelerate(delta uint) { | |
c.Vehicle.speed += int(delta) | |
} | |
func(c *Car) Brake(delta uint) { | |
c.Vehicle.speed -= int(delta) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Car struct { | |
Vehicle | |
} | |
func(c *Car) Accelerate(delta uint) { | |
c.Vehicle.speed += int(delta) | |
} | |
func(c *Car) Brake(delta uint) { | |
c.Vehicle.speed -= int(delta) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vehicle.go:65: Amphibian.Accelerate is ambiguous | |
vehicle.go:65: cannot use a (type *Amphibian) as type Drivable in return argument: | |
*Amphibian does not implement Drivable (missing Accelerate method) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
type Vehicle struct { | |
speed int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Vehicle struct { | |
speed int | |
} | |
func(v *Vehicle) Speed() int { | |
return v.speed | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Amphibian struct { | |
Car | |
Boat | |
} | |
func NewAmphibian() Drivable { | |
a := new(Amphibian) | |
return a | |
} |
OlderNewer