This file contains 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
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.9.zip | |
unzip elasticsearch-0.90.9.zip -d /usr/local/elasticsearch | |
cd /usr/local/elasticsearch/elasticsearch-0.90.9 | |
bin/plugin -install elasticsearch/elasticsearch-cloud-aws/1.16.0 | |
bin/plugin -install mobz/elasticsearch-head | |
mv * /usr/local/elasticsearch/ | |
cd .. | |
rm -R elasticsearch-0.90.9 | |
cd config | |
echo '' >> elasticsearch.yml |
This file contains 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() { | |
var myVariable = 'test 123'; | |
console.log(myVaraible); // Uh oh! There's a typo here. | |
// JSLint tells us `'myVaraible' was used before it was defined`, catching the error before it's run | |
}; |
This file contains 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 Browser = require('zombie'); | |
var url = 'http://stackoverflow.com/users/login?returnurl=http%3a%2f%2fchat.stackoverflow.com%2frooms%2f17%2fjavascript'; | |
//url = 'http://chat.stackoverflow.com/rooms/17/javascript'; | |
browser = new Browser({maxWait: 500}); | |
//console.log(browser.cookies); | |
//browser.cookies(url).set('session', '123'); | |
browser.visit(url, function(e) { | |
if (e) return console.error(e); | |
//console.log(browser); |
This file contains 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
document.addEventListener('click', function() { | |
window.setTimeout(function() { | |
var all = document.querySelectorAll('*'); | |
all[Math.floor(Math.random() * all.length)].style.display = 'none'; | |
}, Math.floor(Math.random() * 5000)); | |
}); |
This file contains 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
TAKE ONE: | |
I love Legos. Always have, always will. | |
Back when I was younger, I could build anything with Legos. If I could dream it up, the parts I needed were somewhere in that never-ending bin of childhood glee. Despite being nothing more than a few pennies of plastic, these magic bricks synergistically assembled into futuristic spaceships, mechanized armies, towering skyscrapers and much more. | |
Sadly, I grew older. Reality began to encroach on my well-laid plans for conquest of the universe. My insatiable desire to create never left, and so I turned to programming. In fact, the new constraints reality inflicted added to the challenge, and I enjoyed creating all the more for it. The best part was that it was so wonderfully real - I could run my program and watch all the parts come together and do something. | |
The funny thing about all of this is that the desire to build, while strong, was not the root of my creative drive. What propelled me more were ideas. I've always had crazy ideas. Some are o |
This file contains 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 mysql = require('mysql'); | |
var connection = mysql.createConnection({ | |
user : 'root', | |
password : 'root', | |
database : 'hnmarkov' | |
}); | |
Array.prototype.random = function () { | |
return this[Math.floor(Math.random() * this.length)]; | |
}; |
This file contains 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 | |
# Reminds the coder to rebase on master | |
echo "Don't forget to rebase on master!" |
This file contains 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/bash | |
#Needed to provide alias expansion (so we can use those aliases after the script's finished) | |
shopt -s expand_aliases | |
while read x; | |
do | |
a=`echo $x | tr '[:lower:]' '[:upper:]'`; | |
#Added because the script was picking up empty lines | |
if [ "$a" != '' ] |
This file contains 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
parse js [ | |
thru {console.log("} copy message to {");} (print message) | |
] |