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
<% | |
require 'net/http' | |
def require_web_font(o={}) | |
o = {:family=>"Open Sans",:weights=>["500","500italic"],:url=>"http://fonts.googleapis.com/css"}.merge(o) | |
url = URI.parse(URI::encode("#{o[:url]}?family=#{o[:family]}:#{o[:weights] * ','}")) | |
Net::HTTP.start(url.host,url.port){|http| http.request(Net::HTTP::Get.new(url.to_s))}.body | |
end | |
%> | |
<%= require_web_font({ :family => "Droid Sans", |
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
function formatXml(xml) { | |
var formatted = ''; | |
var reg = /(>)(<)(\/*)/g; | |
xml = xml.toString().replace(reg, '$1\r\n$2$3'); | |
var pad = 0; | |
var nodes = xml.split('\r\n'); | |
for(var n in nodes) { | |
var node = nodes[n]; | |
var indent = 0; | |
if (node.match(/.+<\/\w[^>]*>$/)) { |
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
require 'rack_directory_index.rb' | |
$documentRoot = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'build')) | |
Capybara.app = Rack::Builder.new do |builder| | |
puts "Creating static rack server serving #{$documentRoot}" | |
use Rack::DirectoryIndex | |
run Rack::Directory.new($documentRoot) | |
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 'Install ruby dependencies' | |
task :install_gems do | |
begin | |
require 'bundler' | |
puts '## Using existing bundler installation' | |
rescue LoadError | |
puts '## Installing bundler' | |
system 'gem install bundler' | |
end | |
puts '## Installing gems' |
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
class RestClient | |
constructor: (@endpoint,@$scope) -> | |
populate: (callback) -> | |
@populated = false | |
@errored = false | |
@data = {} | |
jQuery.ajax( | |
url: @endpoint | |
xhrFields: |
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
module Selenium | |
module WebDriver | |
module Firefox | |
class Profile | |
def layout_on_disk | |
firefox_profile = File.expand_path(File.join(File.dirname(__FILE__),'firefox_profile')) | |
profile_dir = create_tmp_copy(firefox_profile) | |
FileReaper << profile_dir | |
install_extensions(profile_dir) |
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
fs = require('fs') | |
class FileList | |
constructor: (dir,exp = '') -> | |
@fileList = [] | |
@pattern = new RegExp(exp) | |
@getFiles(dir) | |
getFiles: (dir) -> | |
files = fs.readdirSync(dir) | |
for file in files | |
name = "#{dir}/#{file}" |
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
class MyDirective | |
constructor: (myService) -> | |
@controller = MyController | |
@controllerAs = myCtrl | |
restrict: 'E' | |
replace: true | |
scope: | |
attributeStuff: '=' | |
link: (scope, element, attr) -> | |
// Link stuff |
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
.battery { | |
$bg: $bright-color; | |
$border: $dark-color; | |
$level-good: $green; | |
$level-bad: $red; | |
font-size: 2px; | |
display: inline-block; | |
width: 4.5em; | |
height: 11em; | |
border: 0.8em solid $bg; |
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
<div class="container"> | |
<h1>Hero Form</h1> | |
<form class="needs-validation was-validated"> | |
<div class="form-row"> | |
<div class="col-md-4 mb-3"> | |
<label for="validationCustomUsername">Username</label> | |
<div class="input-group"> | |
<input [formControl]="usernameinput" type="text" class="form-control {{(usernameinput.invalid && usernameinput.dirty) ? 'is-invalid' : ''}}" id="validationCustomUsername" placeholder="Username"> | |
<div class="invalid-feedback"> | |
Please choose a username. |