This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3350.0 Safari/537.36","lighthouseVersion":"2.8.0","generatedTime":"2018-02-20T06:22:12.973Z","initialUrl":"http://vm7.uat01.oneit.com.au/cf/extensions/cf/smallShopApplication.jsp?proc%2Estage=PUHDG1&sessioncheck=1519107699407&safenew=true&proc%2EID=NGKCXGWGSTLWAQI","url":"http://vm7.uat01.oneit.com.au/cf/extensions/cf/smallShopApplication.jsp?proc%2Estage=PUHDG1&sessioncheck=1519107699407&safenew=true&proc%2EID=NGKCXGWGSTLWAQI","runWarnings":[],"audits":{"is-on-https":{"score":false,"displayValue":"11 insecure requests found","rawValue":false,"extendedInfo":{"value":[{"url":"http://vm7.uat01.oneit.com.au/cf/extensions/cf/smallShopApplication.jsp?proc%2Estage=PUHDG1&sessioncheck=1519107699407&safenew=true&proc%2EID=NGKCXGWGSTLWAQI"},{"url":"http://vm7.uat01.oneit.com.au/cf/generated/stylebootstrap3_bootstrap.datauri.css?hashv=1518691590000"},{"url":"http://vm7.uat01.oneit.com.au/cf/generated/style_j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Mines title block | |
(function($) { | |
Drupal.addMinesTitle = function() { | |
var containerDiv = document.getElementsByClassName('row divisions'); | |
var contents = document.createElement('div'); | |
$(contents).addClass('division'); | |
var link = document.createElement('a'); | |
$(link).addClass('division__link'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def truncate_words(text, length = 6) | |
words = text.split() | |
words[0..(length-1)].join(' ') | |
end | |
def writeQuestion(questText) | |
xml.name { | |
xml.text_ truncate_words(questText.to_s) | |
} | |
xml.questiontext(:format => "html") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Right, now to rewrite this in Ruby :-) | |
<? | |
/* | |
* This example would probably work best if you're using | |
* an MVC framework, but it can be used standalone as well. | |
* | |
* This example also assumes you are using Predis, the excellent | |
* PHP Redis library available here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sweet bro. | |
%w(rubygems sinatra haml sass dm-core dm-timestamps).each {|gem| require gem} | |
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/dev.db") | |
DataMapper.auto_upgrade! | |
get '/' do | |
haml :index | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Deploy to Heroku" | |
task :deploy_heroku do | |
app = 'myappname' | |
temp_path = "/tmp/heroku-deploys/#{app}" | |
deploy_path = "~/heroku-deploys/#{app}" | |
system "mkdir -p #{temp_path}" | |
system "rm -rf #{temp_path}/*" | |
system "tar -C . -cf - . | tar -C #{temp_path}/ -xpf -" | |
system "cd #{temp_path} && find . -regex '.*git.*' -exec rm -rf {} \\;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>g.RaphaelJS Graph Testing</title> | |
<script src='raphael-min.js'></script> | |
<script src='g.raphael-min.js'></script> | |
<script src='g.line-min.js'></script> | |
<script type='text/javascript'> | |
//<![CDATA[ | |
window.onload = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Feeds Checker</h1> | |
<% | |
require 'hpricot' | |
require 'open-uri' | |
f1 = open("http://www.commerce.wa.gov.au/feeds/feed1.xml") | |
feed = Hpricot.XML(f1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'mysql' | |
require 'sqlite3' | |
def with_mysql | |
db_object = Mysql.init() | |
db_object.real_connect('localhost','things','1234','things') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The below Sinatra code works with URLs like: | |
/c/blahblah | |
and | |
/c/http://blah.com/something.php | |
or | |
/c/google.com |
NewerOlder