Skip to content

Instantly share code, notes, and snippets.

Scrypto.owner_class = "Person"
def scrypto_id
Scrypto.owner_id = current_user.person.id
end
@justindthomas
justindthomas / production.log
Created June 28, 2012 17:28
Potential bug in photo.rb
Started POST "/photos?photo%5Bpending%5D=true&photo%5Baspect_ids%5D=all&photo%5Bset_profile_photo%5D=true&qqfile=justin.jpg" for 71.193.134.108 at 2012-06-28 10:26:56 -0700
Processing by PhotosController#create as HTML
Parameters: {"photo"=>{"pending"=>"true", "aspect_ids"=>"all", "set_profile_photo"=>"true"}, "qqfile"=>"justin.jpg"}
Receving public post from person:2098
Completed 500 Internal Server Error in 3897ms
ArgumentError (Unknown region: "us-west-2"):
app/models/photo.rb:83:in `diaspora_initialize'
app/models/user.rb:268:in `build_post'
app/controllers/photos_controller.rb:177:in `legacy_create'
@justindthomas
justindthomas / bro_events
Created December 6, 2012 19:59
Bro Events
--script.py
#!/usr/bin/env python
import sys
import broccoli
@broccoli.event(broccoli.record)
def connection_established(connection):
print "conn", connection.conn_id
jt-simple :: ~ » brew install -v bro
==> Downloading http://www.bro-ids.org/downloads/release/bro-2.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/bro-2.1.tar.gz
/usr/bin/tar xf /Library/Caches/Homebrew/bro-2.1.tar.gz
==> ./configure --prefix=/usr/local/Cellar/bro/2.1 --disable-ruby
./configure --prefix=/usr/local/Cellar/bro/2.1 --disable-ruby
Build Directory : build
Source Directory: /private/tmp/bro-zdDg/bro-2.1
-- The C compiler identification is Clang 4.1.0
-- The CXX compiler identification is Clang 4.1.0

Keybase proof

I hereby claim:

  • I am justindthomas on github.
  • I am jdt (https://keybase.io/jdt) on keybase.
  • I have a public key whose fingerprint is CF32 C86B B2E0 0852 CA02 88C1 01C7 B534 7AD9 DADD

To claim this, I am signing this object:

sudo strace -p 16521
Process 16521 attached
restart_syscall(<... resuming interrupted call ...>) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
## Prepare VyOS image
VYOS_URL="http://mirror.tuxhelp.org/vyos/iso/release/1.1.7/vyos-1.1.7-i586-virt.iso"
if [ ! -f $ROOT_DIR/tmp/vyos.iso.dist ]; then
echo "Preparing base VyOS image..."
wget $VYOS_URL -O $ROOT_DIR/tmp/vyos.iso.dist
mkdir -p $ROOT_DIR/tmp/mnt
sudo mount -o loop -t iso9660 $ROOT_DIR/tmp/vyos.iso.dist $ROOT_DIR/tmp/mnt
mkdir -p $ROOT_DIR/tmp/vyos-orig
cp -r $ROOT_DIR/tmp/mnt/* $ROOT_DIR/tmp/vyos-orig/
Couldn't match expected type ‘Article -> T.Text’
with actual type ‘T.Text’
In the second argument of ‘(##)’, namely
‘T.pack
$ L.unpack $ X.renderHtml $ markdownToHtml $ T.pack $ show content’
In a stmt of a 'do' block:
"articleContent"
##
T.pack
$ L.unpack $ X.renderHtml $ markdownToHtml $ T.pack $ show content
data Article = Article
{ articleId :: Int
, title :: T.Text
, content :: T.Text
, created_at :: LocalTime
}
splice :: (HasPostgres n, Monad n) => C.Splice n
splice = do
main :: IO ()
main = do
putStrLn "Starting Server..."
S.scotty 3000 $ do
S.get "/" $ S.html "Hello World!"
S.get "/articles" $ do
articles <- inHandlerDb $ selectList [] []
S.html ("Articles!" <> (T.pack $ show $ length (articles :: [Entity Article])))
S.get "/articles/:id" $ do