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 verticallyAlignTheDamnThing(){ | |
| var content_height = $(‘#centered-element’).height(); | |
| var window_height = $(document).height(); | |
| // Reposition the div vertically! | |
| var reposition_top_y = (window_height - content_height) / 2; | |
| if(reposition_top_y > 0){ | |
| $(‘#centered-element’).css(‘margin-top’, reposition_top_y + ‘px’); | |
| } | |
| } |
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
| weather(){ | |
| # Usage: | |
| # weather 13210 | |
| # weather syracuse ny | |
| # weather "new york" ny | |
| # weather nyc | |
| if [ $2 ] | |
| then | |
| 1=$(echo "$1" | sed -e "s/ /_/g") |
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
| import os | |
| import sys | |
| if len(sys.argv) < 2: | |
| print('Usage: python setup.py <netid>') | |
| sys.exit(0) | |
| netid = sys.argv[1] | |
| os.system('sudo echo kernel.randomize_va_space = 0 > /etc/sysctl.d/01-disable-aslr.conf') |
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 foo() { | |
| alert("fdf"); | |
| } |
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
| bool hasDoubleDecker(values) { | |
| if (values == null || values.length < 5) { | |
| return false; | |
| } | |
| for (var i = 0; i < values.length - 4; i++) { | |
| if (values[i] == values[i + 2] && | |
| values[i] == values[i + 4] && | |
| values[i + 1] == values[i + 3]) { | |
| return 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
| void main() { | |
| List<String> ourList = ['a', 'b', 'c']; | |
| for (int i = 0; i < ourList.length; i++) { | |
| print(ourList[i]); | |
| } | |
| } |