Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.
In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.
While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.
Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio
// c++ -o nanopng nanopng.cpp && ./nanopng /tmp/foo.png | |
#include <cstdio> | |
// write an uncompressed PNG file from a uint8 RGB buffer | |
struct Png { | |
FILE*f; unsigned int tab[256], crc; ~Png() { fclose(f); } | |
Png(const char* fn, int w, int h, const unsigned char* c) { | |
crc=0x575e51f5;unsigned char d[]={137,80,78,71,13, | |
10,26,10,0,0,0,13,73,72,68,82,73,68,65,84,120,1,0, | |
0,0,73,69,78,68,174,66,96,130};/*chunk headers*/ |
// Nodejs encryption with GCM | |
// Does not work with nodejs v0.10.31 | |
// Part of https://github.com/chris-rock/node-crypto-examples | |
var crypto = require('crypto'), | |
algorithm = 'aes-256-gcm', | |
password = '3zTvzr3p67VC61jmV54rIYu1545x4TlY', | |
// do not use a global iv for production, | |
// generate a new one for each encryption | |
iv = '60iP0h6vJoEa' |