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
import requests | |
import random | |
response = requests.get('http://jservice.io/api/clues?category=139').json() | |
my_number = random.randint(0, 100) | |
answer = input(response[my_number]['question']) | |
if answer == response[my_number]['answer']: |
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
IFS=, | |
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; } | |
while read student_username | |
do | |
aws iam create-user --user-name $student_username | |
aws iam add-user-to-group --group-name students --user-name $student_username | |
aws iam create-login-profile --user-name $student_username --password temporarypassword123! --password-reset-required | |
sleep 10s | |
aws cloud9 create-environment-ec2 --name $student_username --instance-type t2.micro --owner-arn arn:aws:iam::1234567890:user/$student_username | |
done < $INPUT |
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
var racerSize = 40; | |
var racer1X = 0; | |
var racer1speed; //We can create a variable and assign it to a number up here, but can't use functions here. If you want to assign a random number to a variable, do it in the setup function. | |
var racer2X = 0; | |
var racer2speed; | |
var racer3X = 0; | |
var racer3speed; | |
var racer4X = 0; | |
var racer4speed; | |
var startY = 100; |
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 prompt { | |
# Define some local colors | |
local RED="\[\033[0;31m\]" # This syntax is some weird bash color thing I never | |
local LIGHT_RED="\[\033[1;31m\]" # really understood | |
local CHAR="♥" | |
local BLUE="\[\e[0;49;34m\]" | |
# ♥ ☆ - Keeping some cool ASCII Characters for reference | |
# Here is where we actually export the PS1 Variable which stores the text for your prompt |
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 pig_latinize_word(word): | |
vowels = ["a", "e", "i", "o", "u"] | |
if word[0].lower() in vowels: | |
pig_latin_word = word + "ay" | |
else: | |
if word[1].lower() not in vowels: | |
first_letters = word[:2] | |
rest_of_word = word[2:] | |
pig_latin_word = rest_of_word + first_letters + "ay" | |
else: |
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 'nokogiri' | |
require 'open-uri' | |
brazil_html = open("http://brazilwonders.tumblr.com/") | |
brazil_nokogiri = Nokogiri::HTML(brazil_html) | |
pics_array = [] | |
brazil_nokogiri.css('.post.photo').each do |photo| |
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
Your mission, should you choose to accept it, is to | |
BUILD A COMMAND LINE, OBJECT ORIENTED CALCULATOR | |
We're leaving this open ended, so as a team: | |
-Make a plan. What do you want your calculator to do? List out the features you want. | |
-Break your project down into parts. Walk through the checklist with the entire team. | |
-Build each part and then test it! (Don't build everything and forget to test as you work!) |
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
Git Cheat Sheet for Flatiron HS Summer Program | |
1. Once you've created a directory that you want to track, initialize git with `git init`. Make sure your directory contains a README.md file. | |
2. To set up your github.com directory: | |
a. Go to your profile on github.com. | |
b. Click on the + button on the top right of the page. Choose 'new repository' | |
c. Give your new repository the same name as your local project. | |
d. In your terminal, add the github repository as 'origin.' You should be able to copy this from the github page once you've save it: `git remote add origin [email protected]:dfenjves/repository-name.git` | |
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
opening_string = week_hash[day].split(" - ")[0] | |
t = Time.new(2000,1,1,(opening_string[0..1].to_i),(opening_string[3..4].to_i)) | |
@open = t.strftime("%H:%M") | |
closing_string = week_hash[day].split(" - ")[1] | |
p = Time.new(2000,1,1,(closing_string[0..1].to_i+12),(closing_string[3..4].to_i)) | |
@close = p.strftime("%H:%M") |
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
# Build a class EmailParser that accepts a string of unformatted | |
# emails. The parse method on the class should separate them into | |
# unique email addresses. The delimiters to support are commas (',') | |
class EmailParser | |
def initialize(emails) | |
@emails = emails | |
end |
NewerOlder