Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"iter"
"slices"
"strconv"
"example.org/int/typ"
)
package main
import (
"fmt"
"example.org/int/typ"
)
func main() {
for item := range items {
package main
import (
"fmt"
"example.org/int/typ"
)
func main() {
for item := range items {
package main
import (
"fmt"
"unsafe"
)
func main() {
fmt.Println("Sizeof(Variant{}) =", unsafe.Sizeof(Variant{}), "bytes")
for item := range items {

When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$

@bbasata
bbasata / hello-ruby.md
Created November 6, 2017 21:44
Hello Ruby
  1. Programming Ruby: the classic “pick-axe” book. it’s a tome — i haven’t read it cover-to-cover. i think it’s useful for the first few chapters & then coming back to it as a reference when i need to get more in-depth on a topic: https://pragprog.com/book/ruby4/programming-ruby-1-9-2-0 — i’m a bit surprised that it seems not to have been updated for Ruby 2.1, 2.2, 2.3, or 2.4 :)

  2. Ruby Koans: I found this really useful for getting over the initial learning curve with Ruby. Fun and approachable. http://rubykoans.com/ — I think this is also a bit dated, though likely still great for fundamentals

  3. Michael Hartl’s Ruby on Rails Tutorial helped me get over the initial learning curve with Rails.

  4. Learn Ruby the Hard Way — I have not read this one. It’s the newest learning-Ruby book that I know of, and I generally have a positive opinion of Zed Shaw’s “* the Hard Way” series.

I would recommend #4 and maybe #2 to someone starting with Ruby. #3 if you want to make sense of Rails. #1 as a reference, tho

@bbasata
bbasata / gist:8e5c6d7943908bb7bc20
Created October 18, 2015 17:35
Ignite talk proposal for devopsdays detroit
[Ignite] Three ways to automate application deployment to Amazon Web Services
Comparing and contrasting full-stack automated app deployment using:
* Ansible, a task-centric tool with uses from configuration management to cloud provisioning
* Terraform, an model-/graph-centric tool for cloud provisioning
* Convox, a Heroku-like open source Platform-as-a-Service offering that can be deployed into your Amazon Web Services account
@bbasata
bbasata / gist:5c5ec40650371e62e970
Last active August 29, 2015 14:19
twitter-pairing with @magnusstahre
SUBMODULE=lib/ansible/modules/core
SUBMODULE_COMMIT=4d9ce9cf2cdee14b1c417e92059d4ef83dbcc457
for superproject_tag in $(git tag); do
git ls-tree -r $superproject_tag | grep $SUBMODULE | awk '{ print $3 }' | while read submodule_commit_in_superproject_tag; do
(cd $SUBMODULE && git rev-list $submodule_commit_in_superproject_tag | grep $SUBMODULE_COMMIT >/dev/null && echo "Found submodule commit in superproject tag $superproject_tag")
done
done
@bbasata
bbasata / gist:7559018
Created November 20, 2013 07:17
Another CoreOS gist
Another CoreOS gist
@bbasata
bbasata / gist:7558982
Created November 20, 2013 07:12
Hello again
Hello again