[WayBack] Node.js ES2015/ES6 support
via: [WayBack] Good thing, compare language/runtime versions support for many items http://node.green/ – David Berneda – Google+
–jeroen
Posted by jpluimers on 2018/05/01
[WayBack] Node.js ES2015/ES6 support
via: [WayBack] Good thing, compare language/runtime versions support for many items http://node.green/ – David Berneda – Google+
–jeroen
Posted in Development, JavaScript/ECMAScript, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2018/02/08
Quite some time ago, I attended a great introductory elasticsearch/kibana workshop by Martijn Laarman (@Mpdreamz, github.com/Mpdreamz and SO martijn-laarman) that lead me into researching a lot of interesting new things:
–jeroen
Posted in Development, JavaScript/ECMAScript, JSON, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2018/01/26
This is why I try to avoid doing web-development: [WayBack] Location, location: location = location … and a 534 other ways to reload the page with JavaScript.
Via [WayBack] location = location … and a 534 other ways to reload the page with JavaScript – ThisIsWhyICode – Google+
–jeroen
Posted in Development, JavaScript/ECMAScript, Scripting, Software Development, Web Development | Leave a Comment »
Posted by jpluimers on 2018/01/02
Sometimes your Atom installation gets so unstable that the quickest solution is a reinstall. For that you need to get a list of user-installed packages, then re-install them.
On Windows your Atom Package Manager apm is here (but not in the path), where the first is version specific and the latter the most recent version:
%LOCALAPPDAT%\atom\app-1.18.0\resources\cli\apm.cmd
%LOCALAPPDATA%\atom\bin\apm.cmd
On Mac OS X, it is here and in the path:
/usr/local/bin/apm
/Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm
Save your packages:
apm list --installed --bare > package-list.txt
Install packages:
apm install --packages-file package-list.txt
For my own memory, the settings folders:
%USERPROFILE%\.atom~/.atom–jeroen
via:
Posted in atom editor, Development, JavaScript/ECMAScript, Node.js, Power User, Scripting, Software Development, Text Editors | Leave a Comment »
Posted by jpluimers on 2017/12/07
Ah, C. The best lingua franca we have… because we have no other lingua francas. Linguae franca. Surgeons general? C is fairly old — 44 years, now! — and comes from a time when there were possibly more architectures than programming languages. It works well for what it is, and what it is is a relatively simple layer of indirection atop assembly. Alas, the popularity of C has led to a number of programming languages’ taking significant cues from its design, and parts of its design are… slightly questionable. I’ve gone through some common features that probably should’ve stayed in C and my justification for saying so. The features are listed in rough order from (I hope) least to most controversial. The idea is that C fans will give up when I call it “weakly typed” and not even get to the part where I rag on braces. Wait, crap, I gave it away.
Great re-read towards the end of the year: [WayBack] Let’s stop copying C / fuzzy notepad
Via: [WayBack] Old and busted: emacs vs vi. New and hot: Language war, everybody against everybody else. – Kristian Köhntopp – Google+
–jeroen
Posted in .NET, APL, Awk, bash, BASIC, C, C#, C++, COBOL, CoffeeScript, CommandLine, D, Delphi, Development, F#, Fortran, Go (golang), Java, Java Platform, JavaScript/ECMAScript, Pascal, Perl, PHP, PowerShell, PowerShell, Python, Ruby, Scala, Scripting, Software Development, TypeScript, VB.NET, VBScript | 3 Comments »
Posted by jpluimers on 2017/12/04
via: [WayBack] Hacker News – coinmon: In case you don’t want to install 61 packages [1] :) and [WayBack] The curl + jq based approach to check Bitcoin prices looks a bit more attractive than using a node.js package with 61 dependencies, doesn’t it? Source:… – ThisIsWhyICode – Google+
Function to call curl from bash:
$ coinmon() { > curl "https://api.coinmarketcap.com/v1/ticker/?convert=$1" | jq ".[0] .price_$1" > } $ coinmon eur "6988.4723188"
Or in Python (from the same HackerNew thread): [Archive.is] https://www.pastery.net/jnscrh/
#!/usr/bin/env python3 from urllib.request import urlopen from decimal import Decimal import json def print_coin(coin): print("{} ticker:".format(coin["name"])) print("Price: {:,} EUR".format(Decimal(coin["price_eur"]))) print("Market cap: {:,} EUR".format(Decimal(coin["market_cap_eur"]))) print() r = urlopen("https://api.coinmarketcap.com/v1/ticker/?convert=eur") coins = json.loads(r.read().decode("utf8")) for coin in coins: if coin["id"] in ("bitcoin", "ethereum", "ripple", "monero"): print_coin(coin)
–jeroe
Posted in Development, JavaScript/ECMAScript, Node.js, Software Development | Leave a Comment »
Posted by jpluimers on 2017/11/08
No more issue reporting: tohosokawa/rst-preview-pandoc: reStructuredText preview in Atom using Pandoc
This is a very useful Atom.io package, but it has one big issue: when you close a preview window then re-opening it, the settings are restored to the default -frst -thtml --webtex ones.
As I’m an Atom.io n00b, I need to dig into this another time.
Notes:
module.exports in the path pandocOpts.default.opts_ = atom.config.get 'rst-preview-pandoc.pandocOpts'.I want the defaults to include --standalone --toc --toc-depth=5 or at least --standalone --toc.
For now I’ve hardcoded them.
–jeroen
Posted in atom editor, CoffeeScript, Development, JavaScript/ECMAScript, Power User, Scripting, Software Development, Text Editors | Leave a Comment »
Posted by jpluimers on 2017/11/03
Via [WayBack] Graph of programming languages influence poster – nice gift idea for programmers… – This is why I Code – Google+:
A network graph with more than a thousand programming languages connected by influence relations. Highly influential languages like Lisp, Smalltalk, C, Java, Pascal, C++, Haskel or Python are shown as larger circles as compared to languages with little influence on others like PHP or Argh!. / The influence relation data was retrieved from Freebase in 2013. This design available on posters and other products. An awesome gift for programmers who are into digital art. • Also buy this artwork on wall prints, apparel, kids clothes, and more.
[WayBack] “Network Graph of Programming Language Influence – White Background” Posters by ramiro | Redbubble
I wonder how they drew the relations and why certain languages are in certain places.
--jeroen
Posted in C, C++, COBOL, Development, Haskell, Java, Java Platform, JavaScript/ECMAScript, LISP, Pascal, Perl, PHP, Python, Ruby, Scripting, Smalltalk, Software Development, Turbo Prolog | Leave a Comment »
Posted by jpluimers on 2017/11/02
Quoted in full because even 2.5 years later, it’s just too funny:
- Python: What if everything was a dict?
- Java: What if everything was an object?
- JavaScript: What if everything was a dict *and* an object?
- C: What if everything was a pointer?
- APL: What if everything was an array?
- Tcl: What if everything was a string?
- Prolog: What if everything was a term?
- LISP: What if everything was a pair?
- Scheme: What if everything was a function?
- Haskell: What if everything was a monad?
- Assembly: What if everything was a register?
- Coq: What if everything was a type/proposition?
- COBOL: WHAT IF EVERYTHING WAS UPPERCASE?
- C#: What if everything was like Java, but different?
- Ruby: What if everything was monkey patched?
- Pascal: BEGIN What if everything was structured? END
- C++: What if we added everything to the language?
- C++11: What if we forgot to stop adding stuff?
- Rust: What if garbage collection didn’t exist?
- Go: What if we tried designing C a second time?
- Perl: What if shell, sed, and awk were one language?
- Perl6: What if we took the joke too far?
- PHP: What if we wanted to make SQL injection easier?
- VB: What if we wanted to allow anyone to program?
- VB.NET: What if we wanted to stop them again?
- Forth: What if everything was a stack?
- ColorForth: What if the stack was green?
- PostScript: What if everything was printed at 600dpi?
- XSLT: What if everything was an XML element?
- Make: What if everything was a dependency?
- m4: What if everything was incomprehensibly quoted?
- Scala: What if Haskell ran on the JVM?
- Clojure: What if LISP ran on the JVM?
- Lua: What if game developers got tired of C++?
- Mathematica: What if Stephen Wolfram invented everything?
- Malbolge: What if there is no god?
–jeroen
Posted in .NET, APL, Assembly Language, BASIC, C, C#, C++, COBOL, Development, EPS/PostScript, Fun, Go (golang), Java, Java Platform, JavaScript/ECMAScript, LISP, Makefile, Pascal, Perl, PHP, Python, Quotes, Ruby, Rust, Scala, Scripting, Smalltalk, Software Development, T-Shirt quotes, TCL, Turbo Prolog, VB.NET, Visual BASIC, XML/XSD, XSLT | Leave a Comment »
Posted by jpluimers on 2017/10/11
Yes there is; it’s the answer below. Note I needed to exclude false by adding a check value === false to the code below as that was a valid value for me.
You can just check if the variable has a
truthyvalue or not. That meansif( value ) { }will evaluate to
trueifvalueis not:
- null
- undefined
- NaN
- empty string (“”)
- 0
- false
The above list represents all possible
falsyvalues in ECMA-/Javascript. Find it in the specification at theToBooleansection.Furthermore, if you do not know whether a variable exists (that means, if it was declared) you should check with the
typeofoperator. For instanceif( typeof foo !== 'undefined' ) { // foo could get resolved and it's defined }If you can be sure that a variable is declared at least, you should directly check if it has a
truthyvalue like shown above.Further read: http://typeofnan.blogspot.com/2011/01/typeof-is-fast.html
Thanks to [WayBack] User jAndy – Stack Overflow who answered the above at [WayBack] Is there a standard function to check for null, undefined, or blank variables in JavaScript? – Stack Overflow.
–jeroen
Posted in Development, JavaScript/ECMAScript, Scripting, Software Development | Leave a Comment »