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
| /////////////////////////////////// | |
| // 5. More about Objects; Constructors and Prototypes | |
| // Objects can contain functions. | |
| var myObj = { | |
| myFunc: function(){ | |
| return "Hello world!"; | |
| } | |
| }; | |
| myObj.myFunc(); // = "Hello world!" |
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
| 99.downto(1) do |bottles| | |
| puts "#{bottles} bottle#{"s" if bottles != 1} of beer on the wall.", | |
| "#{bottles} bottle#{"s" if bottles != 1} of beer.", | |
| "Take one down, pass it around.", | |
| "#{bottles - 1} bottle#{"s" if bottles - 1 != 1} of beer on the wall.\n\n" | |
| end | |
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
| #!/bin/sh | |
| echo "Status Script Running"; | |
| DATE=$(date); | |
| WHO=$(who); | |
| UPTIME=$(uptime); | |
| #PSTREE=$(pstree) | |
| RESULT=$DATE"\n"$WHO"\n"$UPTIME |
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
| svn st | awk '$1 == "M"{print $2;}'| xargs svn diff |
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 f in *; do mv "$f" `echo $f | tr ' ' '_'`; done |
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
| /* bling.js */ | |
| window.$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function (name, fn) { | |
| this.addEventListener(name, fn); | |
| } | |
| NodeList.prototype.__proto__ = Array.prototype; |
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
| /*! | |
| * Dynamically changing favicons with JavaScript | |
| * Works in all A-grade browsers except Safari and Internet Explorer | |
| * Demo: http://mathiasbynens.be/demo/dynamic-favicons | |
| */ | |
| // HTML5™, baby! http://mathiasbynens.be/notes/document-head | |
| document.head || (document.head = document.getElementsByTagName('head')[0]); | |
| function changeFavicon(src) { |
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
| find ~/<directory> -exec file -b --mime-type {} + | sort | uniq -c | sort -nr |
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
| ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//' |
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
| // Searches current directory recursively using extended regular expressions for Hex Codes i.e. : | |
| // Single or double quote group+maybe a # sign+xdigits with a range of 6+ single or double quote group | |
| grep -rE --color "(\'|\")#?[[:xdigit:]]{6,6}(\'|\")" . |