This file contains hidden or 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 "log" | |
| var i int | |
| func bsearch(target int, array []int) int { | |
| low := 0 | |
| hi := len(array) |
This file contains hidden or 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 mailer wraps Mandrill's REST API only for sending emails using templates. | |
| package mailer | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| "fmt" | |
| "net/http" | |
| ) |
This file contains hidden or 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/bash | |
| for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do | |
| name=`echo "$branch" | sed 's|remotes/origin/||'` | |
| git branch --track "${name}" "$branch" | |
| done |
This file contains hidden or 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
| // GetByID returns an Account instance given its id which is either: | |
| // username or email. | |
| func (r *RepoPostgres) GetByID(id string) (*Account, error) { | |
| a := new(account) | |
| err := r.db.Get(a, "SELECT * FROM accounts WHERE username = $1 OR email = $1", id) | |
| if err != nil { | |
| return nil, translateError(err) | |
| } | |
| a.Account.PictureURL, _ = url.Parse(a.PictureURL) |
This file contains hidden or 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
| A member of the Go community is: | |
| Open | |
| Members of the community are open to collaboration, patches, problems, or | |
| otherwise. We're receptive to constructive comment and criticism, as the | |
| experiences and skill sets of other members contribute to the whole of our | |
| efforts. We're accepting of all who wish to take part in our activities, | |
| fostering an environment where anyone can participate and everyone can make a | |
| difference. |
This file contains hidden or 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
| FROM ubuntu-debootstrap:14.04 | |
| RUN echo 'deb http://archive.ubuntu.com/ubuntu trusty main' >/etc/apt/sources.list | |
| RUN echo 'deb http://archive.ubuntu.com/ubuntu trusty-security main' >>/etc/apt/sources.list | |
| RUN echo 'deb http://archive.ubuntu.com/ubuntu trusty-updates main' >>/etc/apt/sources.list | |
| RUN echo 'deb http://archive.ubuntu.com/ubuntu trusty universe' >>/etc/apt/sources.list | |
| RUN apt-get update | |
| RUN apt-get install -y --force-yes \ |
This file contains hidden or 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
| func main() { | |
| var logWriter io.Writer | |
| if config.LogFilePath != "" { | |
| var err error | |
| logWriter, err = os.OpenFile(config.LogFilePath, os.O_RDWR|os.O_APPEND, 0660) | |
| if err != nil { | |
| log.Printf("[WARN] %v", err) | |
| } | |
| } |
This file contains hidden or 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
| install_oem_package() { | |
| local oem_pkg=$(_get_vm_opt OEM_PACKAGE) | |
| local oem_use=$(_get_vm_opt OEM_USE) | |
| #local oem_tmp="${VM_TMP_DIR}/oem" | |
| if [[ -z "${oem_pkg}" ]]; then | |
| return 0 | |
| fi | |
| info "Installing ${oem_pkg} to OEM partition" |