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
f = open("AOCDay1.txt", "r") | |
with open('AOCDay1.txt') as f: | |
elf_calories = [line.rstrip('\n') for line in f] | |
elves = [] | |
i = 0 | |
# we have to create the array element before we can add to it | |
elves.insert(i, '') | |
for elf in elf_calories: |
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
with open("Day1_input.txt", "r") as f: | |
modules = [int(x) for x in f.readlines()] | |
#part 1 | |
fuel = sum((y // 3 - 2) for y in modules) | |
print(fuel) | |
#3390596 | |
#holyshit | |
#part 2 |
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
with open("Day1_input.txt", "r") as f: | |
modules = [int(x) for x in f.readlines()] | |
#part 1 | |
fuel = sum((y // 3 - 2) for y in modules) | |
print(fuel) | |
#3390596 | |
#holyshit | |
#part 2 |
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
<div class="about-container"> | |
<div> | |
<img src="//cdn.shopify.com/s/files/1/2933/2634/files/Kennys_Outside-01_2048x2048.png?v=1517860975" alt="" /> | |
</div> | |
<div class="about-block"> | |
<p class="about-text"> | |
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
<html> | |
<head> | |
<title>Pad MP Calc</title> | |
<script type="text/javascript"> | |
function go() { | |
var qparam = []; | |
if(this.no10mp.checked) { qparam.push("no10mp=True"); } | |
if(this.no1mp.checked) { qparam.push("no1mp=True"); } | |
if(this.no5mp.checked) { qparam.push("no5mp=True"); } | |
if(this.noonteam.checked) { qparam.push("noonteam=True"); } |
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> | |
$(".original tbody").on( "click", "tr", function() { | |
var row_id = ($(this).attr('class').split(' ')[0]); | |
if ($('.selected .' + row_id).length > 0) { | |
// do nothing, probably should use .not() up there | |
} else { | |
$(this).addClass('cloned').clone().prependTo($('.selected')); |
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> | |
$("tbody tr").click(function() { | |
if ($(this).parents().hasClass('selected')) { | |
$(this).appendTo($('.original')); | |
} else { | |
$(this).appendTo($('.selected')); | |
} | |
calculate(); | |
}) | |
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
#!/bin/bash | |
bashSource="data/file.txt" | |
if [ -e $bashSource ]; then | |
echo $bashSource "File exists!" | |
else | |
echo $bashSource "File does not exist!" | |
fi |
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
// If component already has a slice | |
if(componentArray[i].hasOwnProperty('slice')){ | |
// Fade out current slice | |
componentArray[i].slice.fadeOut(200,function(){ | |
// Swipe slice source | |
this.src = '/sites/default/files/generated_image/' + view + '_' + component_id + '-' + swatch_id + '.png'; | |
// Fade back in | |
jQuery(this).fadeIn(200); | |
}); | |
} else { |
NewerOlder