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
#!usr/bin/env python | |
# Get Atomic Time from Internet Clock | |
# This program will get the true atomic time from an atomic time clock on the | |
# Internet. There are various clocks across the world. | |
# Do a search for a list of them. | |
import urllib2 | |
from bs4 import BeautifulSoup |
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
# Shape Area and Perimeter Classes | |
# Create an abstract class called Shape and then inherit | |
# from it other shapes like diamond, rectangle, circle, triangle etc. | |
# Then have each class override the area and perimeter functionality to handle each shape type. | |
import math | |
class Shape(object): | |
def __init__(self): |
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 pygame | |
import random | |
import sys | |
from pygame.locals import * | |
def collide(x1,x2,y1,y2,wh): | |
w1=20; | |
w2=wh; | |
h2=wh; | |
h1=20; | |
if x1+w1>x2 and x1<x2+w2 and y1+h1>y2 and y1<y2+h2: |
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
# Rock-paper-scissors-lizard-Spock template | |
# The key idea of this program is to equate the strings | |
# "rock", "paper", "scissors", "lizard", "Spock" to numbers | |
# as follows: | |
# | |
# 0 - rock | |
# 1 - Spock | |
# 2 - paper |
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
# template for "Guess the number" mini-project | |
# input will come from buttons and an input field | |
# all output for the game will be printed in the console | |
"""import some modules""" | |
import random, simplegui | |
# initialize global variables used in your code | |
secret_number = random.randrange(0, 100) | |
secret_number_range = 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
# template for "Guess the number" mini-project | |
# input will come from buttons and an input field | |
# all output for the game will be printed in the console | |
"""import some modules""" | |
import random, simplegui | |
# initialize global variables used in your code | |
secret_number = random.randrange(0, 100) | |
secret_number_range = 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
#!/usr/bin/env python | |
## TODO: less mixed file types DONE | |
## TODO: less ramifications (truncate after a certain depth) DONE | |
## TODO: file/dir modification and removal DONE | |
from __future__ import print_function | |
import os, random, string, subprocess, time, shutil, md5 | |
extensions = ['css', 'js', 'html', 'cpp', 'txt', 'png', 'c'] | |
def make_empty_file(path, name): |
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
SERVER = "outlook.office365.com" | |
FROM = "mohan.sha@qubecinema.com" | |
TO = ["mohan.sha@qubecinema.com"] # must be a list | |
SUBJECT = "Cloud Test mail" | |
TEXT = "This mail was sent from mohan.sha@qubecinema.com email" | |
# Prepare actual message | |
message = """From: %s\r\nTo: %s\r\nSubject: %s\r\n\ |
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
<? | |
///////////////////// | |
// slack2html | |
// by @levelsio | |
///////////////////// | |
// | |
///////////////////// | |
// WHAT DOES THIS DO? | |
///////////////////// | |
// |
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
from slacker import Slacker | |
import json | |
import argparse | |
import os | |
import shutil | |
import copy | |
from datetime import datetime | |
# This script finds all channels, private channels and direct messages | |
# that your user participates in, downloads the complete history for |