Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
| { | |
| movies(options: { limit: 10 }) { | |
| title | |
| actors { | |
| name | |
| } | |
| } | |
| } |
The early programmer struggles with the Javascript keyword this. But understanding your this context is easier than it seems.
This is all about where a function is invoked.
Often, early programmers worry about where the function was declared. Perhaps the function was declared in a specific file or a particular object. Surely this changes it's this!
Nope.
| using System; | |
| using System.Text.RegularExpressions; | |
| namespace Urlify | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var newString = "How to make pancakes "; |
| using System; | |
| using System.Text; | |
| public class PasswordGenerator | |
| { | |
| public static void Main() | |
| { | |
| int passwordLength = 15; | |
| string password = GeneratePassword(passwordLength); |
A collection of links to the "Master the JavaScript Interview" series of medium stories by Eric Elliott.
A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.
Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.
| // Generic Partial Application Function | |
| // https://jsbin.com/biyupu/edit?html,js,output | |
| // https://gist.github.com/ericelliott/f0a8fd662111ea2f569e | |
| // partialApply(targetFunction: Function, ...fixedArgs: Any[]) => | |
| // functionWithFewerParams(...remainingArgs: Any[]) | |
| const partialApply = (fn, ...fixedArgs) => { | |
| return function (...remainingArgs) { | |
| return fn.apply(this, fixedArgs.concat(remainingArgs)); | |
| }; |
| // Secret - creates closures with secret messages. | |
| // https://gist.github.com/ericelliott/f6a87bc41de31562d0f9 | |
| // https://jsbin.com/hitusu/edit?html,js,output | |
| // secret(msg: String) => getSecret() => msg: String | |
| const secret = (msg) => () => msg; | |
| test('secret', assert => { | |
| const msg = 'secret() should return a function that returns the passed secret.'; |
| const getSecret = (secret) => { | |
| return { | |
| get: () => secret | |
| }; | |
| }; | |
| test('Closure for object privacy.', assert => { | |
| const msg = '.get() should have access to the closure.'; | |
| const expected = 1; | |
| const obj = getSecret(1); |