Skip to content

Instantly share code, notes, and snippets.

b={}
a[1...a.length].each do |m|
if b.key? m[3]
b[m[3]].push m
else
b[m[3]] = [m]
end
end
@AumCoin
AumCoin / table
Last active October 1, 2019 19:06
<table class="subject table-bordered table">
<caption class="text-left">
Part 1
</caption>
<thead>
<tr class="bg-primary">
<th scope="col">Item No.</th>
<th scope="col">Column 1<br>
Substance</th>
<th scope="col">Column 2<br>
@AumCoin
AumCoin / output
Created September 30, 2019 23:35
root@slackapptest:/var/log/apache2# gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.10.4/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20190914-24160-1m7bnw8.rb extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
Building native extensions. This could take a while...
ERROR: Error installing google_drive:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.10.4/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20190914-23641-ab02iy.rb extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
#!/usr/bin/ruby
require "rubygems"
require "json"
require "faraday"
require "csv"
require "google/apis/drive_v3"
require "googleauth"
require "googleauth/stores/file_token_store"
require "fileutils"
import random
import playingcard
class Hand(slef,numCardsInHand)
def __init__(self,numCardsInHand):
self.numCardsInHand = numCardsInHand
cards = []
# Generate cards randomly and add to cards[]
suits = ["h","c","d","s"]
while(numCardsInHand > 0)
class Employee():
def __init__(self,first,last,ssn,sal):
self.first = first
self.last = last
self.ssn = ssn
self.sal = sal
def __str__(self):
outstring = '{0}, {1} - ${2} - {3}'.format(self.last,self.first,self.sal,self.ssn)
return outstring
def giveRaise(self,percentRaise):
def rip_prices ### This takes about 3 minutes
products = {}
currencies = ["EUR","USD"]#,"GBP","AUD","CAD","CZK","DKK","MXN","NOK","SEK","TRY"]
currencies.each do |currency|
unless File.exist?("google_" + currency + "_english_1.xml")
puts "File google_" + currency + "_english_1.xml does not exist. Skipping..."
next
end
puts "processing " + currency + " file."