Method - 1
#!/usr/bin/env php
Method - 1
#!/usr/bin/env php
| function upperCaseFirst(inputStr) { | |
| var valueOfFirstChar = inputStr.charCodeAt(0); | |
| console.log('Value of first character:', valueOfFirstChar); | |
| var upperCaseLetter = String.fromCharCode(valueOfFirstChar - 32); | |
| console.log('Uppercase first character:', upperCaseLetter); | |
| var restOfString = inputStr.slice(1); | |
| console.log('Rest of the string:', restOfString); |
| #!/usr/bin/env bash | |
| # | |
| # url : https://gist.github.com/672684 | |
| # version : 2.0.2 | |
| # name : appify | |
| # description : Create the simplest possible mac app from a shell script. | |
| # usage : cat my-script.sh | appify MyApp | |
| # platform : Mac OS X | |
| # author : Thomas Aylott <[email protected]> |
| #!/bin/bash | |
| if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
| appify v3.0.1 for Mac OS X - http://mths.be/appify | |
| Creates the simplest possible Mac app from a shell script. | |
| Appify takes a shell script as its first argument: | |
| `basename "$0"` my-script.sh |
| /** | |
| * Deep diff between two object, using lodash | |
| * @param {Object} object Object compared | |
| * @param {Object} base Object to compare with | |
| * @return {Object} Return a new object who represent the diff | |
| */ | |
| function difference(object, base) { | |
| function changes(object, base) { | |
| return _.transform(object, function(result, value, key) { | |
| if (!_.isEqual(value, base[key])) { |
| (function() { | |
| var script, | |
| scripts = document.getElementsByTagName('script')[0]; | |
| function load(url) { | |
| script = document.createElement('script'); | |
| script.async = true; | |
| script.src = url; | |
| scripts.parentNode.insertBefore(script, scripts); |