In functional programming you often want to apply a function partly. A simple example is a function add.
It would be nice if we could use add like:
var res2 = add(1, 3); // => 4
var add10To = add(10);
var res = add10To(5); // => 15
| #!/bin/bash | |
| ################ | |
| # Uncomment if you want the script to always use the scripts | |
| # directory as the folder to look through | |
| #REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| REPOSITORIES=`pwd` | |
| IFS=$'\n' |
| package main | |
| /** | |
| * @website http://albulescu.ro | |
| * @author Cosmin Albulescu <[email protected]> | |
| */ | |
| import ( | |
| "bytes" | |
| "fmt" |
| import React, { useCallback, useEffect, useRef, useState } from 'react'; | |
| import Button from 'components/UI/button/button'; | |
| import styling from './useDialog.module.scss'; | |
| export default (cb) => { | |
| const [{ open, params }, setDialogMeta] = useState({ open: false }); | |
| const containerRef = useRef(null); |
This gist shows how to connect to your vagrant MySQL database from the host machine.
vagrant ssh/etc/mysql/my.cnf:
bind-address to 0.0.0.0 to allow all incoming connection attempts| <?php | |
| error_reporting(E_ALL); | |
| $charsets = array( | |
| "ISO-8859-1" => "Western European, Latin-1. ", | |
| "ISO-8859-5" => "Little used cyrillic charset (Latin/Cyrillic). ", | |
| "ISO-8859-15" => "Western European, Latin-9. Adds the Euro sign, French and Finnish letters missing in Latin-1 (ISO-8859-1). ", | |
| "UTF-8" => "ASCII compatible multi-byte 8-bit Unicode. ", | |
| "cp866" => "DOS-specific Cyrillic charset. ", |
| # Author : Shiva Bhusal | |
| # github: shivabhusal | |
| # stackoverflow: users/3437900/illusionist | |
| ########################################## | |
| # Usages: | |
| # - create a file called ~/.promptrc | |
| # - add following in ~/.bashrc | |
| # `source ~/.promptrc` | |
| # # this will include the source of the file |
| #!/bin/bash | |
| # What it is: a script to compile and install Nginx manually in Ubuntu 14.04 server | |
| # Author: Pothi Kalimuthu | |
| # Author URL: http://pothi.info | |
| # License: GPL v2 | |
| ### VARIABLES ### | |
| # Please know that this script should be executed as normal user with __sudo__ privileges. |