We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
| /* | |
| I found it handy to reduce the amount of manual require() lines in a big | |
| project by grouping small modules together like below. | |
| If you put this code into "index.js" then it'll pick up any other | |
| JS modules in that directory and expose them as sub-modules. | |
| - Any exports in *this* module would be myPackage.exportName | |
| - Any exports in other modules would be myPackage.moduleName.exportName |
| <?php | |
| //Quotes: Replace smart double quotes with straight double quotes. | |
| //ANSI version for use with 8-bit regex engines and the Windows code page 1252. | |
| preg_replace('[\x84\x93\x94]', '"', $text); | |
| //Quotes: Replace smart double quotes with straight double quotes. | |
| //Unicode version for use with Unicode regex engines. | |
| preg_replace('[\u201C\u201D\u201E\u201F\u2033\u2036]', '"', $text); |
We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
| $(window).on("scroll", function() { | |
| var scrollHeight = $(document).height(); | |
| var scrollPosition = $(window).height() + $(window).scrollTop(); | |
| if ((scrollHeight - scrollPosition) / scrollHeight === 0) { | |
| // when scroll to bottom of the page | |
| } | |
| }); |
| # SYNTAX: | |
| var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches) | |
| var pattern = /pattern/attributes; # same as above | |
| # BRACKETS: | |
| [...]: Any one character between the brackets. | |
| [^...]: Any one character not between the brackets. |
| /* iPhone 6 landscape */ | |
| @media only screen and (min-device-width: 375px) | |
| and (max-device-width: 667px) | |
| and (orientation: landscape) | |
| and (-webkit-min-device-pixel-ratio: 2) | |
| { } | |
| /* iPhone 6 portrait */ | |
| @media only screen | |
| and (min-device-width: 375px) |
| #!/bin/bash | |
| # Stop all containers | |
| containers=`docker ps -a -q` | |
| if [ -n "$containers" ] ; then | |
| docker stop $containers | |
| fi | |
| # Delete all containers | |
| containers=`docker ps -a -q` | |
| if [ -n "$containers" ]; then | |
| docker rm -f -v $containers |
| ; Language: English | |
| ; VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV | |
| ; > Uses unicode. Save this file as utf-8 with BOM. < | |
| ; > Else it shall not work. < | |
| ; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ; | |
| #NoEnv ; Recommended | |
| SendMode Event | |
| SetWorkingDir %userprofile% ; Ensures a consistent starting directory. | |
| ; |
| // This is based on original code from http://stackoverflow.com/a/22649803 | |
| // with special credit to error454's Python adaptation: https://gist.github.com/error454/6b94c46d1f7512ffe5ee | |
| function EnhanceColor(normalized) { | |
| if (normalized > 0.04045) { | |
| return Math.pow( (normalized + 0.055) / (1.0 + 0.055), 2.4); | |
| } | |
| else { return normalized / 12.92; } | |
| } |