Skip to content

Instantly share code, notes, and snippets.

View anoldguy's full-sized avatar

Nathan Anderson anoldguy

View GitHub Profile
@anoldguy
anoldguy / Whole Wheat Bread Recipe.txt
Created February 22, 2016 19:32 — forked from jamis/Whole Wheat Bread Recipe.txt
Jamis' recipe for homemade whole wheat bread
Jamis' Whole Wheat Bread
Ingredients
(Pardon the mixed metric/imperial units. I'm a product of my time.)
27 oz warm water
1 tbl shortening
2 tbl yeast (active dry or instant)
package main
import (
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/gpio"
"github.com/hybridgroup/gobot/platforms/raspi"
"github.com/hybridgroup/gobot/api"
"log"
)
@anoldguy
anoldguy / fail.go
Last active December 22, 2015 20:18
package main
import (
"bufio"
"fmt"
"net"
)
func requestHandler(conn net.Conn) {
defer conn.Close()
@anoldguy
anoldguy / lookup.go
Last active December 21, 2015 20:17
package main
import (
"bufio"
"errors"
"fmt"
"log"
"net"
"strings"
)
@anoldguy
anoldguy / _fail.md
Last active December 21, 2015 15:08

Given the ruby code in the script, I would expect user.groups to be scoped by both of the deleted_at conditions. This was the behavior up thru Rails f55c60f. This was changed in bc6ac8 to fix a regression. This issue persists thru master.

Rails f55c60f

SELECT "groups".* 
FROM "groups" 
INNER JOIN "assignments" 
ON "groups"."id" = "assignments"."assignable_id" 
WHERE "assignments"."deleted_at" IS NULL -- This is the missing clause
AND "assignments"."user_id" = 1 
(function() {
var CalendarDate, RelativeTime, browserIsCompatible, domLoaded, iso8601, months, pad, parse, process, relativeDate, relativeTimeAgo, relativeTimeOrDate, relativeWeekday, run, strftime, update, weekdays;
browserIsCompatible = function() {
return document.querySelectorAll && document.addEventListener;
};
if (!browserIsCompatible()) {
return;
}

INGREDIENTS

  • 1/2 cup small-dice bacon (about 3 ounces)
  • 1/2 cup finely diced red onion (about 1/2 small onion)
  • 2 medium garlic cloves, finely chopped
  • 1 cup ketchup
  • 1/2 cup cider vinegar
  • 1/2 cup packed dark brown sugar
  • 1/4 cup Worcestershire sauce
  • 3 tablespoons bourbon
  • 2 tablespoons dark or robust molasses (not blackstrap)

Keybase proof

I hereby claim:

  • I am anoldguy on github.
  • I am mr_ndrsn (https://keybase.io/mr_ndrsn) on keybase.
  • I have a public key whose fingerprint is 21AD 56C0 2424 D3F4 9974 F368 87F5 06AD 08DB E511

To claim this, I am signing this object:

How Companies Communicated Being Hacked

It’s probably a pretty bad idea to have your site go down, when people are supposed to read the blog post explaining the hack.

Notice how another site reporting the hack received more attention than Twitter’s own announcement. Why was that?

@anoldguy
anoldguy / test.rb
Created May 29, 2013 17:42
SQL Injection?
# Is the following safe from SQL injection?
Model.where(Model.arel_table[:name].matches("%#{params[:q]}%"))