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 the page has children: we want to display them in a gallery of featured images --> | |
<?php | |
if ($children = get_children(array( 'post_parent' => $post->ID ))){ | |
foreach ($children as $child){ | |
$link = get_permalink($child->ID); | |
echo "<div class='col-md-4 text-center fabric-child'>"; | |
echo "<a href='$link'>"; |
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
h1 { | |
font-size: 1.25em; | |
} | |
h2 { | |
font-size: 1.125em; | |
} | |
h3 { | |
font-size: 1.05em; |
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
def solution(a) | |
n = a.size | |
prefix_sum = [0] | |
a.each do |e| | |
prefix_sum << prefix_sum.last + e | |
end | |
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
hgroup { | |
padding-top: 96px; | |
background-image: url('https://norwichchurches.files.wordpress.com/2015/05/luckhurst-nchchurches-31.jpg?w=192'); | |
background-repeat: no-repeat; | |
background-position: top center; | |
background-size: 96px 96px; | |
min-height: 96px; | |
} | |
.site-header h1 { |
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
$OUTPUT_AUTOFLUSH = 1; # this thing turns off buffering between newlines | |
while (1) { | |
print "perl% "; | |
my $command = <STDIN>; # get some user input | |
last if $command eq ''; # exit the loop | |
chomp $command; # remove newline from our input | |
my ($program, @args) = split /\s+/, $command; | |
my $pid = fork; | |
if (! defined $pid) { print STDERR "Couldn't fork: $!\n" } |
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
## .nanorc examples from http://www.if-not-true-then-false.com/2009/tuning-nano-text-editor-with-nanorc/ | |
## [email protected] 11 December 2015. | |
set smooth | |
set autoindent | |
set backup | |
set backupdir "/tmp/nano-backups" | |
set historylog |
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> | |
<body> | |
<h1>Seasonal fruits and vegetables in Ontario, sorted by month</h1> | |
<p>Data source: www.foodlandontario.ca</p> | |
<div id="results"></div> | |
</body> | |
<script> |
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
1 #!/usr/bin/env python | |
2 import re, sys, collections | |
3 | |
# open the file and split on commas. | |
4 stops = open(’../stop_words.txt’).read().split(’,’) | |
# what is the re.findall()? what does {2,} mean? | |
# read file specified by command line arguments, convert to lower case, findall a-zs | |
5 words = re.findall(’[a-z]{2,}’, open(sys.argv[1]).read().lower()) | |
# what is collections.Counter()? | |
# increment counts[w] for w in words, if it isn't in Stop Words. |
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
<canvas id="gc" width="400" height="400"></canvas> | |
<script> // https://youtu.be/xGmXxpIj6vs?t=3m46s | |
window.onload=function() { | |
canv=document.getElementById("gc"); | |
ctx=canv.getContext("2d"); | |
document.addEventListener("keydown",keyPush); | |
setInterval(game,1000/15); | |
} | |
px=py=10; // player x,y |
OlderNewer