Skip to content

Instantly share code, notes, and snippets.

@JakenHerman
JakenHerman / make_ends.py
Created February 13, 2014 18:35
make_ends on Coding Bat
__author__ = 'Jaken'
def make_ends(nums):
first = nums[0]
last = nums[len(nums) -1]
x = [first, last]
return x
@JakenHerman
JakenHerman / middle_way.py
Created February 13, 2014 18:36
middle_way on Coding Bat
__author__ = 'Jaken'
def middle_way(a, b):
amid = a[1]
bmid = b[1]
x = [amid, bmid]
return x
@JakenHerman
JakenHerman / love6.py
Created February 13, 2014 19:31
love6 on Coding Bat
def love6(a, b):
sum = a+b
diff = a-b
diff2 = b-a
if a == 6 or b == 6:
return True
elif sum == 6 or diff == 6 or diff2 == 6:
return True
@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