Content :
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| Same signature as fetch. It returns a ready to use curl command with | |
| {headers} optional JSON {body}, {method} and CLI {curlCliOptions} | |
| curl('https://en.wikipedia.org/api/rest_v1/page/summary/Cehegin', | |
| { | |
| headers: { accept: 'application/json' }, | |
| body: {}, | |
| method: 'GET' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @flow | |
| import { useCallback } from 'react'; | |
| import { useDispatch } from 'react-redux'; | |
| import * as routePaths from '~/constants/routes'; | |
| import { GET_SMART_CHARGING } from '~/state/products/ev-charger/actions'; | |
| const ROUTES_PREFETCH_ACTIONS = { | |
| [routePaths.evChargerSettings]: { | |
| type: GET_SMART_CHARGING, | |
| routeArgsToActionPayload: ({ id, ...restOfNavigationArguments }) => ({ deviceId: id }), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Welcome! require() some modules from npm (like you were using browserify) | |
| // and then hit Run Code to run your code on the right side. | |
| // Modules get downloaded from browserify-cdn and bundled in your browser. | |
| var profanity = require('profanity-util'); | |
| console.log(profanity.purify('Brassie', { | |
| obscureSymbol: '$' | |
| })); | |
| // [ 'foo p$$p', ['poop'] ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Welcome! require() some modules from npm (like you were using browserify) | |
| // and then hit Run Code to run your code on the right side. | |
| // Modules get downloaded from browserify-cdn and bundled in your browser. | |
| var profanity = require('profanity-util'); | |
| console.log(profanity.purify('Brassie', { | |
| obscureSymbol: '$' | |
| })); | |
| // [ 'foo p$$p', ['poop'] ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const restActionTypes = ['REQUEST', 'ADD_REQUEST', 'SUCCESS', 'REFRESH', 'FAILURE', 'SELECT', 'RESET', 'SAVE', 'PLATFORM_REQUEST', 'PLATFORM_SUCCESS', 'PLATFORM_FAILURE', 'PAYMENT_RESULT'] | |
| const authActionTypes = ['START', 'SUCCESS', 'FAILURE', 'EXPIRED', 'END', 'CACHE_REQUEST', 'CACHE_SUCCESS', 'CACHE_FAILURE', 'DECODED'] | |
| const fcmActionTypes = ['TOKEN_REFRESHED', 'TOKEN_SAVE', 'TOKEN_SAVED', 'NOTIFICATION_RECEIVED', 'TOPICS_RECEIVED', 'OPTIONAL_TOPICS_PREFS_LOAD', /* 'OPTIONAL_TOPICS_PREFS_SAVE', unused for now */ 'OPTIONAL_TOPICS_PREFS_UPDATED', 'BACKGROUND_DATA_RECEIVED'] | |
| const errorActionTypes = ['HTTP', 'AUTH', 'INTERNAL'] | |
| // Helper to build objects like the one below and prevent name clashes and typos | |
| // { FAILURE:"USER_FAILURE" | |
| // REQUEST:"USER_REQUEST" | |
| // SELECT:"USER_SELECT" | |
| // SUCCESS:"USER_SUCCESS"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;http://www.4clojure.com/problem/39#prob-title | |
| (= (#(let [result (zipmap % %2)] | |
| (apply concat result)) [1 2 3] [:a :b :c]) | |
| '(1 :a 2 :b 3 :c)) | |
| (= (#(let [result (zipmap % %2)] | |
| (apply concat result)) [1 2] [3 4 5 6]) | |
| '(1 3 2 4)) |
I hereby claim:
- I am jaimeagudo on github.
- I am jal (https://keybase.io/jal) on keybase.
- I have a public key whose fingerprint is 739B 7FE4 A527 8072 82F2 D03C 45A2 0F3D 8206 2E8C
To claim this, I am signing this object:
defprotocol: defines an interfacedeftype: create a bare-bones object which implements a protocoldefrecord: creates an immutable persistent map which implements a protocol
Typically you'll use defrecord (or even a basic map);
unless you need some specific Java inter-op,
where by you'll want to use deftype instead.
Note:
defprotocolallows you to add new abstractions in a clean way Rather than (like OOP) having polymorphism on the class itself,
NewerOlder