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 ( | |
"net" | |
"log" | |
"io" | |
"fmt" | |
) | |
func main() { |
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
Making a bootable USB key from an .iso image on Mac OS X | |
Purpose | |
The purpose of this exercise is to take an ISO image that you’ve downloaded and contains a bootable filesystem intended to be burned onto a CDROM. Instead we’re going to put it on a USB key so that a machine with the ability to boot from USB keys can boot it the exact same as if it were a CDROM. | |
NOTE: Intel Based Apple Machines contain an EFI BIOS that CANNOT boot USB keys. You will not be able to put your OS X .iso file onto a USB key and install it onto an Apple laptop (MacBook Pro/Air/etc). | |
We’ll be doing most of this from a terminal, with the help of disk utility for some things. | |
Prepare the USB key |
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
/* disable font boosting on mobile browsers */ | |
body * { | |
max-height: 1000000em; /* Chrome for Android */ | |
-moz-text-size-adjust: none; /* Firefox Mobile */ | |
} |
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
echo "# sample" >> README.md | |
git init | |
git add --all | |
git commit -m "first commit" | |
git remote add origin https://github.com/GoesToEleven/sample.git | |
git push -u origin master |
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
https://git-for-windows.github.io/ |
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
Open a Terminal (under Utilities) | |
Run diskutil list and determine the device node assigned to your flash media (e.g. /dev/disk2) | |
Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command; in the previous example, N would be 2) | |
Execute sudo dd if=/path/to/downloaded.iso of=/dev/diskN bs=1m (replace /path/to/downloaded.iso with the path where the image file is located; for example, ./windows7.iso) | |
Run diskutil eject /dev/diskN and remove your flash media when the command completes (this can take a few hours on slower drives) |
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
var b bytes.Buffer // A Buffer needs no initialization. | |
b.Write([]byte("Hello ")) | |
fmt.Fprintf(&b, "world!") | |
b.WriteTo(os.Stdout) | |
// OUTPUT: | |
// Hello world! |
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
ctx := appengine.NewContext(req) | |
i, err := memcache.Get(ctx, "Homepage") | |
if err != memcache.ErrCacheMiss { | |
buf := bytes.NewBuffer(make([]byte)) | |
writ := io.MultiWriter(res, buf) | |
tpl.ExecuteTemplate(writ, "home.html", nil) | |
memcache.Set(ctx, memcache.Item{ | |
Value: buf.String(), | |
Key: "Homepage", | |
}) |
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
if path.Dir(req.URL.Path) == "/public/favicons" { | |
fname := path.Base(req.URL.Path) | |
http.ServeFile(res, req, "./public/favicons/"+fname) | |
return | |
} |
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
$ git reset SHA --hard | |
// HEAD is now at SHA ...msg... | |
$ git push origin -f |
NewerOlder