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
Hi all! I'd like your input on something: | |
I'm about to start building my first big project. I've built smaller things before, but they were all for Joomla. I'd like to expand my knowledge with an ambitious project. | |
Here's what we're aiming to build: | |
-A search engine that only searches our database (no web crawling, etc). | |
-A payment system to purchase what our users find. | |
I'm looking for whatever will allow us to get this up and running quickly, but allow for further customization later. Good documentation/tutorials are a must. It doesn't need to do the above (we're big fans of writing our own code for core functions). |
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
"use strict"; | |
//Require other files | |
var server = require("./server"); | |
var router = require("./router"); | |
var requestHandlers = require("./requestHandlers"); | |
//Create autoloader/handler | |
var handle = {}; | |
handle["/"] = requestHandlers.home; | |
handle["/admin"] = requestHandlers.admin; |
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
What if you could use the same language anywhere you go? Server/clientside, desktop, mobile, game dev, physics simulators, EBook readers, etc. This sounds like a pipe dream, and it is in a way. If it was possible, what would we want the language to look like? It would have to be: | |
Fast | |
Open and Extensible | |
Simple, yet powerful | |
Easy to debug (If it's appropriate to yell "HEEEEY MACARENA" at the end of your message, it might be too complicated). | |
Language nesting (You can write the language in the language) | |
Well-documented | |
(An argument could be made for rapid prototyping, but this usually relies more on libraries than the language). |
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
//This one caches the previous results so we're not constantly re-calculating things we already know | |
//Fiddle: http://jsfiddle.net/somekittens/7R5bs/ | |
function fibDriver(n) { | |
return n === 0 ? 0 : fib(0, 1, n); | |
} | |
function fib(a, b, n) { | |
return n === 1 ? b : fib(b, a + b, n-1); | |
} |
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) | |
] |
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
#!/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
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
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
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)); | |
}); |
OlderNewer