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
| { | |
| "env": { | |
| "browser": true, | |
| "node": true, | |
| "amd": true | |
| }, | |
| "rules": { | |
| "no-console": 2, | |
| "no-comma-dangle": 2, |
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
| set nocompatible | |
| set t_Co=256 | |
| filetype off | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| Bundle 'gmarik/Vundle.vim' |
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 requireRole(role) { | |
| return function(req, res, next) { | |
| if (req.session.user && req.session.user.role === role) { | |
| next(); | |
| else { | |
| res.send(403); | |
| } | |
| } | |
| } |
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 |
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
| _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 "(?<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
| /* 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
| 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
| String.prototype.repeat = function(n) { | |
| const str = this; | |
| return Array.apply(null, Array(n)).map(() => str).join(''); | |
| } | |
| // "foo".repeat(3) | |
| // foofoofoo |