If you're trying to do this, you came to the right place!
Watch this code work in real time: https://twitter.com/CodingDoug/status/940022568089554944
See also this gist for copying in the other direction: https://gist.github.com/CodingDoug/44ad12f4836e79ca9fa11ba5af6955f7
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
- There are always 24 hours in a day.
- February is always 28 days long.
- Any 24-hour period will always begin and end in the same day (or week, or month).
| /** | |
| * This script expects the global variables 'refresh_token' and 'firebase_api_key' to be set. 'firebase_api_key' can be found | |
| * in the Firebase console under project settings then 'Web API Key'. | |
| * 'refresh_token' as to be gathered from watching the network requests to https://securetoken.googleapis.com/v1/token from | |
| * your Firebase app, look for the formdata values | |
| * | |
| * If all the data is found it makes a request to get a new token and sets a 'auth_jwt' environment variable and updates the | |
| * global 'refresh_token'. | |
| * | |
| * Requests that need authentication should have a header with a key of 'Authentication' and value of '{{auth_jwt}}' |
I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.
For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.
Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.
| /*<?php | |
| //*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s", | |
| //\u000A\u002F\u002A | |
| class PhpJava { | |
| static function main() { | |
| echo(//\u000A\u002A\u002F | |
| "Hello World!"); | |
| }} | |
| //\u000A\u002F\u002A | |
| PhpJava::main(); |
| var Promise = require('bluebird'); | |
| var funcs = Promise.resolve([500, 100, 400, 200].map((n) => makeWait(n))); | |
| funcs | |
| .each(iterator) // logs: 500, 100, 400, 200 | |
| .then(console.log) // logs: [ [Function], [Function], [Function], [Function] ] | |
| funcs | |
| .mapSeries(iterator) // logs: 500, 100, 400, 200 |
| #!/bin/bash | |
| MONGO_DATABASE="your_db_name" | |
| APP_NAME="your_app_name" | |
| MONGO_HOST="127.0.0.1" | |
| MONGO_PORT="27017" | |
| TIMESTAMP=`date +%F-%H%M` | |
| MONGODUMP_PATH="/usr/bin/mongodump" | |
| BACKUPS_DIR="/home/username/backups/$APP_NAME" |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |