Skip to content

Instantly share code, notes, and snippets.

View MicahBrown's full-sized avatar

Micah Brown MicahBrown

  • Manhattan, KS
  • 10:05 (UTC -05:00)
View GitHub Profile
data_file = Roo::Excelx.new('spreadsheet.xlsx')
sheet1 = data_file.sheet(0)
sheet2 = data_file.sheet(1)
puts sheet1.row(1).inspect
puts sheet2.row(1).inspect
# Gives this output
["Sheet 2"]
@MicahBrown
MicahBrown / Upload.asp
Created April 10, 2017 21:08
Code Injection Issue Files
<%
If Not Session("loginokay") Then
Response.Redirect "gallerylogin.asp"
End If
%>
<!DOCTYPE html>
<html>
<head>
<title>Gallery | IKC</title>
<!-- #Include file="references.html" -->
@MicahBrown
MicahBrown / authorize_resource.rb
Created December 24, 2016 20:33
Load and Authorize Resource
require 'active_support/concern'
# Derived from cancan gem (https://github.com/ryanb/cancan)
# This authorizes by checking the current resource's associated user.
#
# Options:
# :auth_method - Pass a symbol corresponding to the current resource's user
# association that you'd like to authorize against.
#
# Default => :user