I hereby claim:
- I am jheth on github.
- I am jheth (https://keybase.io/jheth) on keybase.
- I have a public key ASDDKUcgCopBv1edZ1pM1dKLxO6FRZ719jWdYQa3d4JEmwo
To claim this, I am signing this object:
reader := bufio.NewReader(os.Stdin) | |
fmt.Print("Skip? ") | |
text, _ := reader.ReadString('\n') | |
fmt.Println(text) | |
if strings.HasPrefix(strings.ToLower(text), "y") { | |
continue | |
} |
I hereby claim:
To claim this, I am signing this object:
docker pull swaggerapi/swagger-ui | |
docker tag swaggerapi/swagger-ui registry.heroku.com/outdoorsy-swagger/web | |
docker push registry.heroku.com/outdoorsy-swagger/web | |
heroku container:release web --app outdoorsy-swagger |
^[^iIoOqQ'-]{10,17}$ |
// NullInt64 is an alias for sql.NullInt64 data type | |
type NullInt64 sql.NullInt64 | |
// MarshalJSON for NullInt64 | |
func (ni *NullInt64) MarshalJSON() ([]byte, error) { | |
if !ni.Valid { | |
return []byte("null"), nil | |
} | |
return json.Marshal(ni.Int64) |
-- great way to batch update using a sub-query in the from clause | |
update category set catid=100 | |
from ( | |
select event.catid | |
from event | |
left join category cat on event.catid = cat.catid | |
where cat.catid is null | |
limit 1000 | |
) eventcat | |
where category.catid = eventcat.catid |
// Hacky way to strip unicode characters. | |
func CleanText(text string, maxLength int) string { | |
if len(text) < 5 { | |
return "" | |
} | |
if strings.Contains(text, "\n") { | |
sections := strings.Split(text, "\n") | |
newText := sections[0] | |
for idx, s := range sections { |
# Default 1 MB | |
show variables like 'max_allowed_packet' | |
# 10 MB | |
set global max_allowed_packet=10485760 |
redis-cli KEYS "Proposal*" | xargs redis-cli DEL |
# Turn off the automatic pager | |
Pry.config.pager = false | |
# Make the prompt silly. | |
Pry.config.prompt_name = 'oh no!' | |
# Hit Enter to repeat last command | |
#Pry::Commands.command(/^$/, 'repeat last command') do | |
# _pry_.run_command Pry.history.to_a.last | |
#end |