Skip to content

Instantly share code, notes, and snippets.

inventory_location_ids = Inventory::Location.for_market('BAY').pluck(:id)
orders =
Order
.for_partner(:att)
.active
.where(inventory_location_id: inventory_location_ids)
# orders = Order.where(public_id: [list])
orders.each do |order|
<HTML>
<body>
<h1>Hello</h1>
</body>
</HTML>
@surrealdetective
surrealdetective / aa-bloc-mentor.md
Last active December 16, 2017 20:51
Fundamental Mentor - Candidate Assessment

Section 1 Responses

  1. What does a doctype do?

doctype lets the browser know how to read your HTML. You should put it at the beginning of every HTML page. For HTML5, it looks like <!DOCTYPE html> (though in earlier versions of HTML it was more verbose).

If you don't use it on an HTML page, then different browsers will incorrectly read your HTML in different ways (for example, Internet Explorer will differ from Opera, which will also differ from Firefox).

By including the doctype at the top of the page, the browser can correctly parse the HTML, and the look of the page will be more predictable across browsers.


@surrealdetective
surrealdetective / jquery-lab-fis002-alex-au
Last active December 19, 2015 03:39
First practice with Jquery
/*
Table of Contents
1. ./public/js/app.js
2.index.html
*/
//app.js
$(document).ready(function(){
class SecretHandshake
attr_accessor :code, :shake
def initialize(code)
@code = code
@shake = []
end
def is_wink
module Enumerable
def flatiron_flatten(hashy = @hash)
hashy.delete_if {|key, value| value == nil}
hashy.each do |pair|
if pair[1].class == Hash
flatiron_flatten(pair[1])
end
end
end
@surrealdetective
surrealdetective / playlister-cli-fis002-alex-au
Created June 23, 2013 21:54
Playlister CLI - for those downcase songs
#Table of Contents:
#1. main.rb
#2. parser.rb
#3. artist.rb
#4. song.rb
#5. genre.rb
#shoutout to George Lin, whose code I leaned on heavily to learn re: parser.rb
#------------------------# 1. main.rb #------------------------#
@surrealdetective
surrealdetective / divisible-20-warmup
Created June 21, 2013 13:33
#https://piazza.com/class#summer2013/002ruby/253 #What is the smallest number that is divisble by every number between 1 - 20?
#https://piazza.com/class#summer2013/002ruby/253
#What is the smallest number that is divisble by every number between 1 - 20?
# def all_divisible(num)
# smallest = []
# (1..num).each do |test|
# if num % test == 0
# smallest << test
# end
# end
def reverse_each_word(sentence)
print sentence.split.each {|word| word.reverse!}.join(" ")
end
reverse_each_word("Hello there, and how are you?")
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'sqlite3'
def getname(webpage)
name = webpage.search('h4.ib_main_header').children
name.inner_text
end