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 Html exposing (text) | |
| main = | |
| text (toString (mergesort [5,3,8,1,9,4,7])) | |
| {-| Sorts a list of values by: | |
| 1. If the list has zero or one element, it is sorted! | |
| 2. If it is longer, split it into two sublists | |
| 3. Sort those sublists |
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 Html exposing (text) | |
| main = | |
| text (toString (quicksort [5,3,8,1,9,4,7])) | |
| quicksort : List comparable -> List comparable | |
| quicksort list = | |
| case list of | |
| [] -> | |
| [] |
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
| npm config set cache-min 9999999 | |
| CACHE ALL THE THINGS!!! | |
| ─────────────────────────────▄██▄ | |
| ─────────────────────────────▀███ | |
| ────────────────────────────────█ | |
| ───────────────▄▄▄▄▄────────────█ | |
| ──────────────▀▄────▀▄──────────█ | |
| ──────────▄▀▀▀▄─█▄▄▄▄█▄▄─▄▀▀▀▄──█ |
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
| String.prototype.repeat = function(n) { | |
| const str = this; | |
| return Array.apply(null, Array(n)).map(() => str).join(''); | |
| } | |
| // "foo".repeat(3) | |
| // foofoofoo |
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
| var flattenArray = require('../flattenArray'); | |
| describe("flattenArray()", function(){ | |
| it("should return an array", function() { | |
| var test = flattenArray([1,2,3]); | |
| expect(test).to.be.an('array'); | |
| expect(test.length).to.equal(3); | |
| }); | |
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
| /* Mobile */ | |
| @media only screen and (max-width: 767px) { | |
| [class*="mobile hidden"], | |
| [class*="tablet only"]:not(.mobile), | |
| [class*="computer only"]:not(.mobile), | |
| [class*="large screen only"]:not(.mobile), | |
| [class*="widescreen only"]:not(.mobile), | |
| [class*="or lower hidden"] { | |
| display: none !important; |
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
| _sourceCategory=Apache/Access | |
| | parse regex "(?<client_ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" | |
| | parse regex "[A-Z]+ (?<url>.+) HTTP/1.1" | |
| | where client_ip = "166.94.146.84" | |
| | timeslice 1m | |
| | count as hits by url, _timeslice | |
| | transpose row _timeslice column url |
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
| _sourceCategory=Apache/Access | |
| | parse regex "(?<client_ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" | |
| | timeslice 1m | |
| | count as hits by _timeslice, client_ip | |
| | transpose row _timeslice column client_ip |
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
| _sourceCategory=Apache/Access | |
| | parse regex "\"[A-Z]+\s+\S+\s+HTTP/[\d\.]+\"\s+\S+\s+(?<size>\d+)\s+\S+\s+\"(?<agent>[^\"]+?)\"" | |
| | parse regex field=agent "(?<bot_name>facebook)externalhit?\W+" nodrop | |
| | parse regex field=agent "Feedfetcher-(?<bot_name>Google?)\S+" nodrop | |
| | parse regex field=agent "(?<bot_name>PaperLiBot?)/.+" nodrop | |
| | parse regex field=agent "(?<bot_name>TweetmemeBot?)/.+" nodrop | |
| | parse regex field=agent "(?<bot_name>msn?)bot\W" nodrop | |
| | parse regex field=agent "(?<bot_name>Nutch?)-.+" nodrop | |
| | parse regex field=agent "(?<bot_name>Google?)bot\W" nodrop | |
| | parse regex field=agent "Feedfetcher-(?<bot_name>Google?)\W" nodrop |
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
| sudo apt-get install openjdk-7-jre-headless -y | |
| cd /home/user/ | |
| mkdir -p dynamodb && cd dynamodb | |
| wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest | |
| tar -xvzf dynamodb_local_latest | |
| mv dynamodb_local_latest/ dynamodb/ | |
| cat >> dynamodb.conf << EOF |