I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
Warning: These views are highly oppinated and might have some slightly incorrect facts. My experience with typescript was about 2 weeks in Node and a week in angular2.
TypeScript is implementing their own take on JavaScript. Some of the things they are writing will likely never make it in an official ES* spec either.
Technologies that have competing spec / community driven development have a history of failing; take: Flash, SilverLight, CoffeeScript, the list goes on. If you have a large code base, picking TypeScript is something your going to be living with for a long time. I can take a bet in 3 years JavaScript will still be around without a doubt.
Its also worth noting that they have built some things like module system and as soon as the spec came out they ditched it and started using that. Have fun updating!
export class Observable_ extends Observable { | |
private _json: Object = {}; | |
constructor(key: string, args: Object) { | |
super(args); | |
this._json = (args != null && typeof args === 'object') ? args : {};//initialize object | |
} | |
public set(name: string, value: any) { | |
this._json[name] = value; |
var coinTypes = [25, 10, 5]; | |
var coinNb = [8, 12, 20]; | |
function computeChange(change,coinTypes, coinNb) { | |
var rez = []; | |
for (var i = 0; i < coinTypes.length; ++i) { | |
if (coinTypes[i] === 0) continue; | |
var coinsToGet = Math.floor(change / coinTypes[i]); | |
if (coinsToGet > coinNb[i]) { | |
coinsToGet = coinNb[i]; | |
} |
# location for config | |
# /etc/apache2/conf-available/php5.6-fpm.conf" | |
<IfModule mod_fastcgi.c> | |
AddHandler php5.6-fcgi .php | |
Action php5.6-fcgi /php5.6-fcgi | |
Alias /php5.6-fcgi /usr/lib/cgi-bin/php5.6-fcgi | |
FastCgiExternalServer /usr/lib/cgi-bin/php5.6-fcgi -socket /var/run/php/php5.6-fpm.sock -pass-header Authorization -idle-timeout 3600 | |
<Directory /usr/lib/cgi-bin> | |
Require all granted | |
</Directory> |
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands) | |
gpg --gen-key | |
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null` | |
# check current keys: | |
gpg --list-secret-keys --keyid-format LONG | |
# See your gpg public key: | |
gpg --armor --export YOUR_KEY_ID | |
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333) |