Skip to content

Instantly share code, notes, and snippets.

View blaines's full-sized avatar
:shipit:
Hello World

Blaine Schanfeldt blaines

:shipit:
Hello World
View GitHub Profile
@blaines
blaines / Dockerfile
Created January 11, 2019 01:20
Dockerfile to echo Docker events to STDOUT (So they are captured by logs)
FROM alpine
RUN apk add --no-cache curl
ENTRYPOINT curl -sf --unix-socket /var/run/docker.sock -H "Content-Type: application/json" -X GET http:/v1.39/events
diff --git a/private/protocol/restxml/restxml.go b/private/protocol/restxml/restxml.go
index 65faeae..27e0e86 100644
--- a/private/protocol/restxml/restxml.go
+++ b/private/protocol/restxml/restxml.go
@@ -8,7 +8,10 @@ package restxml
import (
"bytes"
"encoding/xml"
+ "fmt"
"io"
> Pathname.new 'uri:classloader:/Users/bschanfeldt/Repos/Github/jruby/jruby/README.md'
=> <Pathname:uri:classloader:/Users/bschanfeldt/Repos/Github/jruby/jruby/README.md>
> p = _
=> <Pathname:uri:classloader:/Users/bschanfeldt/Repos/Github/jruby/jruby/README.md>
> p.absolute?
=> false
> RUBY_VERSION
=> "1.9.3"
> RUBY_PLATFORM
=> "java"
> JR
JRUBY_REVISION JRUBY_VERSION JRuby
> JR
JRUBY_REVISION JRUBY_VERSION JRuby
> JRUBY_
JRUBY_REVISION JRUBY_VERSION
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="woman">Hello world</Say>
<Play>http://www.radiolovers.com/shows/J/Journeytothecenteroftheearth/Lost.mp3</Play>
</Response>
@blaines
blaines / Assembla Userstyle
Created February 8, 2011 08:57
Using gist because it delivers https!
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("assembla.com") {
#header-w, #main-menu-w, .menu-wrapper {
background-color: #222 !important
}
ul#main-menu li, .more_tabs_menu_item {
background-color: #900 !important
template =
{
form:{
method:"post","class":["new","blogpost"],fields:[
{name:"title",type:"text","class":"title"},
{name:"body",type:"textarea","class":"body"}
]
}
};
// now try
@blaines
blaines / gist:203968
Created October 7, 2009 11:05
A recursive from_xml
def import
xml = open(params[:_]).read # Param for opening an XML file ( http://localhost/import?_=http://localhost/companies.xml )
doc = REXML::Document.new(xml)
@import = initialize_import(doc)
respond_to do |format|
format.html
end
end
# Process parent XML elements
module Prawn
class Document
#module CropMarks
def draw_crop_marks(spacing, margin, lineweight)
#crop mark line thickness
line_width(lineweight)
#spacing = 2.125
#margin = 9
@blaines
blaines / gist:181566
Created September 5, 2009 23:58
Creates an encrypted, base64 encoded url containing signup form parameters. Used for database-less email verification.
class UsersController < ApplicationController
# Creates an encrypted, base64 encoded url. http://localhost/confirm?_=hBRCGVqie5PetQhjiagq9F6kmi7luVxpcpEYMWaxrtSHIPA3rF0Hufy6EgiH%0A%2BL3t9dcgV9es9Zywkl4F1lcMyA%3D%3D%0A
@to_encrypt = save_space(params[:user], {:firstname => :fn,:lastname => :ln,:email => :el,:username => :un,:password => :pd})
encrypted_params = CGI::escape(Base64.encode64(encrypt(Marshal.dump(@to_encrypt), "secret")))
render :text => "#{encrypted_params}"
def confirm
@decrypted = Marshal.load(decrypt(Base64.decode64(params[:_]), "secret"))