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
print("Hello, World!") |
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
#very basic website code for html background tutorial | |
<!DOCTYPE html> | |
<html> | |
<head | |
</head> | |
<body> | |
#remove <body> | |
#replace with <body style="background:url()"> |
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
// Check if page contains the text "Maternal side" | |
function checkPage(url, element, callback) { | |
let newTab = window.open(url, "_blank"); | |
newTab.addEventListener("load", function onTabLoad() { | |
newTab.removeEventListener("load", onTabLoad); | |
let isMaternal = newTab.document.body.textContent.includes("Maternal side"); | |
callback(isMaternal, element, newTab); |
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
string = "This is a Ruby tutorial." | |
# This returns the index where the 1st instance of i occurs | |
string.index('i') | |
# This code returns 2 |
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
string = "This is a Ruby tutorial." | |
# Here we will return an array containing each instance of i | |
string.scan('i') | |
# This code returns ["i", "i", "i"] |
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
string = 'This is a Ruby tutorial.' | |
string.count('i') | |
# This returns the integer 3 | |
# case sensitive example | |
string.count('r') | |
# This returns the integer 1 | |
string.count('r', + 'R') | |
# This returns the integer 2 |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package rollingdie; | |
import java.util.Random; | |
import java.util.Scanner; | |
import java.util.*; | |
import java.util.Arrays; |
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
rename "old" "new" * | |
# * means all files |
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
a = [60, -60] | |
# 4 refers to number of 60s or -60s in each element of array | |
a = a.repeated_permutation(6).to_a | |
puts "The array contains #{a.length} elements." | |
#creates output file called permute.txt | |
out_file = File.new("permute_out.txt", "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
#Purdue North Central doesn't have waitlists, but you can get notified of seat availability with this app | |
require 'rubygems' | |
require 'open-uri' | |
require 'hpricot' | |
require 'twilio-ruby' | |
availability = 0 | |
puts "Enter the CRN for the PNC course you would like to track:" | |
crn = gets.chomp.to_s |
NewerOlder