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
(function($) { | |
$.fn.centerWithinParent = function() { | |
return this.each(function(){ | |
var $this = $(this), | |
parentPosition = $this.parent().css('position'); | |
if (parentPosition !== "absolute" || parentPosition !== "relative") { | |
$this.parent().css('position', 'relative'); |
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
{% comment %} | |
Tag customers and products with "wholesale" tags. | |
{% endcomment %} | |
{% assign isWholesaleCustomer = false %} | |
{% if customer and customer.tags contains 'wholesale' %} | |
{% assign isWholesaleCustomer = true %} | |
{% endif %} |
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
{% if settings.carousel_show %} | |
<div class="flexslider"> | |
<ul class="slides"> | |
{% for i in (1..5) %} | |
{% capture show %}carousel{{ i }}_show{% endcapture %} | |
{% capture image %}carousel{{ i }}.jpg{% endcapture %} | |
{% capture title %}carousel_title{{ i }}{% endcapture %} | |
{% capture link %}carousel_link{{ i }}{% endcapture %} |
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
{% for link in linklists.footer-nav.links %} | |
{% cycle '<ul>', '' %} | |
<li><a href="{{ link.url }}">{{ link.title }}</a></li> | |
{% cycle '', '</ul>' %} | |
{% capture needsEndingElement %}{% cycle 'yes', 'no' %}{% endcapture %} | |
{% endfor %} | |
{% if needsEndingElement == 'yes' %} | |
</ul> | |
{% endif %} |
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
<style> | |
#verify { | |
position: absolute; | |
top: 0; | |
left: 0; | |
background: rgba(67, 157, 207, 0.9); | |
z-index: 200; | |
width: 100%; | |
height: 100%; | |
} |
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
# Assignment 1 - Building a star pyramid | |
# Ask the user to enter a number | |
number_of_rows = int(raw_input('Enter a number: ')) | |
# Write your code below this comment |
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
def getVowels(word, includeY=False, unique=False): | |
matches = [] | |
vowels = 'aeiou' if not includeY else 'aeiouy' | |
for char in word: | |
if char.lower() in vowels: | |
matches.append(char) | |
return list(set(matches)) if unique else matches | |
print getVowels('This is a fancy test string', includeY=True, unique=True) |
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
""" | |
Problem: You are given two files, one contains a list of | |
names (names.txt) and the other a list of phone numbers (numbers.txt). | |
Your boss needs a single CSV file that can be loaded into excel. | |
Your task is to combine both txt files into one CSV file. | |
The first and last names need to be in separate columns | |
and the phone number must be in the format (555)555-5555 |
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
# Ask the user to enter a number | |
number_of_rows = int(raw_input('Enter a number: ')) | |
# Iterate through range of numbers up to what the user entered | |
for row in range(number_of_rows): | |
stars = 1 + row * 2 | |
spaces = number_of_rows - row - 1 | |
print ' ' * spaces + '*' * stars |
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
Name,Number | |
Amal Albertson,7/2/1972 | |
Sondra Shoemaker,2/2/1964 | |
Ryann Ralphs,5/22/1999 | |
Delcie Demma,8/19/1975 | |
Gemma Gates,5/16/1999 | |
Su Scurlock,3/18/1990 | |
Delma Duchene,12/16/1994 | |
Kathyrn Kreps,2/25/1965 | |
Cinda Christon,6/26/1987 |