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
dict={ | |
'cap' : 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'.split(' '), | |
'lowercase' : 'a b c d e f g h i j k l m n o p q r s t u v w x y z'.split(' ') | |
} | |
def find(this, dictionary): | |
for key in dictionary.keys(): | |
if this in dictionary[key]: | |
return key | |
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
#!/usr/bin/python | |
import sys | |
# it's easy to print this list of course: | |
print sys.argv | |
# or it can be iterated via a for loop: | |
for i in range(len(sys.argv)): |
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
import os | |
print("Path at terminal when executing this file") | |
print(os.getcwd() + "\n") | |
print("This file path, relative to os.getcwd()") | |
print(__file__ + "\n") | |
print("This file full path (following symlinks)") | |
full_path = os.path.realpath(__file__) |
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
# design settings | |
gutter = 60 | |
radius = 6 | |
pageW = 1600 | |
# draw filled outline or contours | |
contour = False | |
# draw nodes and bluezones and vertical metrics? |
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
aList = [0, 1, 2, 3] | |
temp = [] | |
j = len(aList)-1 | |
for i in range(j, -1, -1): | |
temp.append(aList[i]) | |
aList = temp |
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
<table> | |
<!-- We may add a caption to our table --> | |
<caption>Caption may come here</caption> | |
<!-- Styling with <col> --> | |
<colgroup> | |
<col> | |
<col> | |
<col style="background-color: yellow"> | |
</colgroup> |
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
let width = window.innerWidth | |
|| document.documentElement.clientWidth | |
|| document.body.clientWidth; | |
let height = window.innerHeight | |
|| document.documentElement.clientHeight | |
|| document.body.clientHeight; |
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
**.class** .intro | |
/* Selects all elements with class="intro" */ | |
**.class1.class2** .name1.name2 | |
/* Selects all elements with both name1 and name2 set within its class attribute */ | |
**.class1 .class2** .name1 .name2 | |
/* Selects all elements with name2 that is a descendant of an element with name1 */ | |
**#id** #firstname |
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
// The function camelise(str) changes dash-separated words | |
// like “my-short-string” into camel-cased “myShortString”. | |
// Removes all dashes, each word after dash becomes uppercased. | |
function camelize(str) { | |
return str.split('-').reduce((a, b) => { | |
return a + b[0].toUpperCase()+b.slice(1); | |
}); | |
} |
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
// vanilla JS solution | |
window.onload = function(){ | |
CODE HERE; | |
}; | |
// vanilla JS solution, equivalent to the code above | |
window.addEventListener("load", function() { | |
CODE HERE; |
OlderNewer