This file contains hidden or 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 os | |
from slackclient import SlackClient | |
### This is whatever name you gave your bot | |
BOT_NAME = 'toggle_bot' | |
### You get this by command export export SLACK_BOT_TOKEN='your slack token pasted here' | |
slack_client = SlackClient(os.environ.get('SLACK_BOT_TOKEN')) |
This file contains hidden or 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 os | |
import time | |
import json | |
import requests | |
import boto3 | |
from flask import Flask, request | |
from slackclient import SlackClient | |
import uuid | |
This file contains hidden or 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
public class forwhile { | |
public static void main(String[] args) { | |
// Create a method called isEvenNumber that takes a parameter of type int | |
// Its purpose is to determine if the argument passed to the method is | |
// an even number or not. | |
// return true if an even number, otherwise return false; | |
isEvenNumber(37); | |
} |
This file contains hidden or 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
package com.scotthutchinson; | |
/** | |
* Created by sjehutch on 6/3/17. | |
*/ | |
public class VipCustomer { | |
// Create a new class VipCustomer | |
// it should have 3 fields name, credit limit, and email address. | |
// create 3 constructors | |
// 1st constructor empty should call the constructor with 3 parameters with default values |
This file contains hidden or 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
# Create a program that takes an IP address entered at the keyboard | |
# and prints out the number of segments it contains, and the length of each segment. | |
# | |
# An IP address consists of 4 numbers, separated from each other with a full stop. But | |
# your program should just count however many are entered | |
# Examples of the input you may get are: | |
# 127.0.0.1 | |
# .192.168.0.1 | |
# 10.0.123456.255 | |
# 172.16 |
This file contains hidden or 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 random | |
highest = 1000 | |
## We get the random number here | |
answer = random.randint(1 , highest) | |
## Now lets ask the person to guess | |
guess = 0 | |
print ("guess a number between 1 and {}".format(highest)) | |
### Check to see if guess = answer |
This file contains hidden or 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
odd = [1,3,5,7,9] | |
even = [2,4,6,8] | |
even.append(10) | |
numbers = odd + even | |
for i in numbers: | |
print (i) | |
numbers.sort() |
This file contains hidden or 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
#add to the program below so that if it finds a meal without spam | |
# it prints out each of the ingredients of the meal. | |
# You will need to set up the menu as we did in lines 5-13 | |
menu = [] | |
menu.append(["egg", "bacon" , "turkey"]) | |
menu.append(["egg", "sausage", "bacon"]) | |
menu.append(["egg", "spam"]) | |
menu.append(["egg", "bacon", "spam"]) | |
menu.append(["egg", "bacon", "sausage", "spam"]) |
This file contains hidden or 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 json | |
import boto3 | |
def lambda_handler(event, context): | |
source = event['source'] | |
target = event['target'] | |
client = boto3.client('rekognition') | |
This file contains hidden or 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
# This little gem checks if a user has seem the same article over and over and over | |
member = "Scott Hutchinson" | |
article = "Amazon buy's Whole Foods" | |
otherArticle = "Dog's start to replace people at Uber" | |
hasViewed = False | |
if member == "Scott Hutchinson": | |
if not hasViewed: | |
print(article) |