Skip to content

Instantly share code, notes, and snippets.

View JakenHerman's full-sized avatar
🫠

Jaken Herman JakenHerman

🫠
View GitHub Profile
@JakenHerman
JakenHerman / in1to10.py
Created February 13, 2014 19:33
in1to10 on Coding Bat
def in1to10(n, outside_mode):
if outside_mode:
if n <= 1 or n >= 10:
return True
else: return False
elif not outside_mode and n >= 1 and n <= 10:
return True
@JakenHerman
JakenHerman / make_out_word.py
Created February 13, 2014 19:38
make_out_word on Coding Bat
def make_out_word(out, word):
return out[0]+out[1]+word+out[2]+out[3]
@JakenHerman
JakenHerman / string_times.py
Created February 13, 2014 19:56
string_times on Coding Bat
__author__ = 'Jaken'
def string_times(str, n):
return str*n
@JakenHerman
JakenHerman / pygLatinTranslator.py
Created February 13, 2014 20:58
Pig Latin Translator written in Python, hence the "PYg" Latin filename.
pyg = 'ay'
original = raw_input('Enter a word:')
word = original.lower()
first = word[0]
new_word = pyg+word
if len(original) > 0 and original.isalpha():
if first == "A" or first == "E" or first == "I" or first == "O" or first == "U":
print new_word
else:
@JakenHerman
JakenHerman / 0_reuse_code.js
Created February 13, 2014 21:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@JakenHerman
JakenHerman / python_resources.md
Created February 13, 2014 21:01 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@JakenHerman
JakenHerman / front3.py
Created February 14, 2014 03:37
front3 in Coding Bat
__author__ = 'Jaken'
def front3(str):
front = str[:3]
return front*3
@JakenHerman
JakenHerman / near10.py
Created February 14, 2014 17:42
near_ten on Coding Bat
__author__ = 'Jaken'
#Given a non-negative number "num",
# return True if num is within 2 of a multiple of 10.
def near_ten(num):
if (num % 10 - 2 == 0) or (num % 10 + 2 == 0) or \
(num % 10 + 1 == 0) or (num % 10 - 1 == 0) or \
(num % 10 - 8 == 0) or (num % 10 + 8 == 0) or \
@JakenHerman
JakenHerman / parrot_trouble.py
Created February 14, 2014 17:55
parrot_trouble in Coding Bat
__author__ = 'Jaken'
def parrot_trouble(talking, hour):
if talking and (hour < 7 or hour > 20):
return True
else:
return False
#instructions were:
#We have a loud talking parrot. The "hour" parameter is the current hour time
@JakenHerman
JakenHerman / makes10.py
Created February 14, 2014 17:56
makes10 Coding Bat Solution
__author__ = 'Jaken'
def makes10(a, b):
sum = a + b
if (sum == 10) or (a == 10) or (b==10):
return True
else:
return False
#instructions were:
#Given 2 ints, a and b, return True if one if them