Skip to content

Instantly share code, notes, and snippets.

@mrosset
mrosset / build
Last active December 10, 2015 02:38
#!/bin/bash
# This is a simple build script and will be executed on your CI system if
# available. Otherwise it will execute while your application is stopped
# before the deploy step. This script gets executed directly, so it
# could be python, php, ruby, etc.
tarball="https://go.googlecode.com/files/go1.0.3.linux-amd64.tar.gz"
# Set GOROOT since we dont use GOROOT_FINAL
export GOROOT="$OPENSHIFT_HOMEDIR/app-root/data/go"
#include "thumb.h"
gdImagePtr loadImage(char *path) {
FILE *fp;
gdImagePtr im;
fp = fopen(path, "rb");
if (!fp) {
assert_perror(errno);
}
package main
import (
"bytes"
"encoding/json"
"fmt"
)
type Person struct {
Name string
01:42 Eridius_ | true. Although you do have to remember to C.free those │
| things │
01:44 belak | How do file uploads work with Go? Like, where is the │
| uploaded file temporarily stored and do you have to unlink │
| it if not used? │
01:55 str1ngs | belak: depends on the server │
01:56 str1ngs | if you control the server you need to impliment it │
02:01 str1ngs | so any io.Writer from Request.Body would work │
02:01 str1ngs | but MultipartReader is probably better. just more complex │
02:04 catery | are there any blog posts on what the typical situation where │
ds /data/data/via/
Human Bytes Path Files
60.0MB 62871324 /data/data/via/lib 240
36.7MB 38496591 /data/data/via/bin 248
17.9MB 18816161 /data/data/via/share 3803
7.7MB 8028493 /data/data/via/arm-unknown-linux-gnueabi 35
7.0MB 7297113 /data/data/via/include 1244
3.8MB 4034392 /data/data/via/sbin 62
382.4KB 391592 /data/data/via/db 27
152.8KB 156509 /data/data/via/etc 8
{{define "main"}}
package main
import (
{{ range .Imports}}
. "{{.}}"
{{end}}
)
func main() {
lstat("/usr/local/etc/nix/nix.conf", 0x7fff2c512f20) = -1 ENOENT (No such file or directory)
pipe([7, 9]) = 0
fcntl(7, F_GETFD) = 0
fcntl(7, F_SETFD, FD_CLOEXEC) = 0
fcntl(9, F_GETFD) = 0
fcntl(9, F_SETFD, FD_CLOEXEC) = 0
pipe([10, 11]) = 0
fcntl(10, F_GETFD) = 0
fcntl(10, F_SETFD, FD_CLOEXEC) = 0
fcntl(11, F_GETFD) = 0
#!/bin/bash
set -e
while inotifywait -e modify -r *.go; do
go build || true
done
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
@mrosset
mrosset / testit
Created June 29, 2012 22:42
watch android project, rebuild,install and run on MODIFY
#!/bin/bash
_testit() {
printf "running "
touch .lock
ant debug install 1> /dev/null
adb shell 'am start -n com.example.thumbs/.ThumbsActivity' 1> /dev/null
rm .lock
echo "Done."
}