Skip to content

Instantly share code, notes, and snippets.

View fd0's full-sized avatar

Alexander Neumann fd0

View GitHub Profile
package main
import (
"fmt"
"github.com/spf13/cobra"
)
var cmdRoot = &cobra.Command{
Run: func(*cobra.Command, []string) {
#!/bin/bash
TMP_AVI=$(mktemp /tmp/outXXXXXXXXXX.avi)
ffcast -w % ffmpeg -y -f x11grab -show_region 1 -framerate 15 \
-video_size %s -i %D+%c -codec:v huffyuv \
-vf crop="iw-mod(iw\\,2):ih-mod(ih\\,2)" $TMP_AVI \
&& convert -set delay 10 -layers Optimize $TMP_AVI out.gif
package main
import (
"io"
"os"
"github.com/fd0/throttle"
)
func main() {
@fd0
fd0 / -
Created March 9, 2017 10:28
diff --git a/build.go b/build.go
index ec55660..8a041df 100644
--- a/build.go
+++ b/build.go
@@ -291,6 +291,12 @@ func (cs Constants) LDFlags() string {
}
func main() {
+ ver := runtime.Version()
+ if strings.HasPrefix(ver, "go1") && ver < "go1.7" {
package main
import (
"fmt"
"os"
"github.com/pkg/xattr"
)
func main() {
#!/bin/sh
set -e
cleanup() {
rm -rf -- "$DATA_DIR"
}
DATA_DIR=$(mktemp -d "${TMP:-/tmp}/google-chrome-XXXXXXXX")
trap cleanup EXIT
touch "${DATA_DIR}/First Run"
chrmm --user-data-dir="$DATA_DIR" --incognito "$@"
package main
import (
"fmt"
"github.com/pkg/xattr"
"os"
)
func main() {
attr, err := xattr.Listxattr(os.Args[1])
func (node Node) sameExtendedAttributes(other Node) bool {
if len(node.ExtendedAttributes) != len(other.ExtendedAttributes) {
return false
}
// build a set of all attributes that node has
type mapvalue struct {
value []byte
present bool
}
package main
import (
"fmt"
"os"
"github.com/pkg/xattr"
)
func main() {
package main
import (
"fmt"
"io"
"os"
"github.com/restic/chunker"
)