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 os, glob | |
path = "/Users/mowong/Documents/Thumbnails/Big_Thumbnail_Project" # update to current dir | |
list = ["1","3","4"] #append here the version number(s) | |
for x in list: | |
for files in glob.glob("/Users/mowong/Documents/Thumbnails/Big_Thumbnail_Project/*-0%s.jpg" % x): | |
os.remove(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
from random import randint | |
import datetime | |
score = 100 | |
round = 1 | |
#date and time included in high scores | |
now = datetime.datetime.now() | |
today = datetime.date.today() | |
numericalDate = "%d/%d/%d" % (today.day, today.month, today.year) |
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, webbrowser | |
def get_reddit_user_info(username): | |
url = "https://www.reddit.com/user/%s.json" % username | |
r = requests.get(url) | |
json_data = r.json() | |
#op = json_data['data']['children'][0]['data']['link_author'] | |
#individualpost = json_data['data']['children'][0]['data'] |
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, webbrowser | |
def get_frontpage_info(): | |
url = "http://www.reddit.com/.json" | |
r = requests.get(url) | |
json_data = r.json() | |
try: |
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 java.util.Scanner; | |
public class SortingAlgorithms { | |
public static void main(String[] args) { | |
int[] anArray = {2, 3, 1, 5, 6, 33, 10, 15, 16, 4, 7, 1000}; | |
int searchTerm; | |
System.out.println("Starting array"); | |
for (int x = 0; x < anArray.length; x ++) | |
System.out.printf("%d ", anArray[x]); |
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 Tkinter import * | |
from math import * | |
from time import sleep | |
import webbrowser | |
class Calculator(): | |
def __init__(self): | |
self.root = Tk() | |
self.root.wm_title("Montana's Calculator") |
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
abbvr = { | |
"lol": "laugh out loud", | |
"dw": "don't worry", | |
"hf": "have fun", | |
"gg": "good game", | |
"brb": "be right back", | |
"g2g": "got to go", | |
"wtf": "what the fuck", | |
"wp": "well played", | |
"gl": "good luck", |
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 os | |
#File extensions to scrape | |
EXT = '.txt' | |
#filter out files to parse within entire directory | |
files = [ | |
file for file in os.listdir('.') | |
if os.path.isfile(file) | |
and file.endswith('.txt') | |
and file.startswith('no_') |
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 reverseInt($n){ | |
return reverseIntAcc(0, $n); | |
} | |
function reverseIntAcc($acc, $n){ | |
if ($n == 0){ | |
return $acc; | |
} | |
$acc *= 10; | |
return reverseIntAcc($acc + ($n % 10) , floor($n / 10)); |
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
<script> | |
$(document).ready( function () { | |
$('#customerTripsTable').DataTable(); | |
$('#customerNotesTable').DataTable(); | |
} ); | |
//reset all children nodes in tree if the parent is clicked | |
document.getElementById("contacttype").onclick = destroyChildren; | |
//listener for contact type dropdown | |
document.getElementById("contacttype").onchange = function() { | |
var selected = document.getElementById("contacttype").value; |
OlderNewer