This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps argument of the connect function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps can take.
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
| // workaround for https://github.com/ionic-team/ionic/issues/13294 | |
| // probably breaks iPhone X support | |
| .ios ion-nav > .ion-page > .toolbar.statusbar-padding:first-child, | |
| .ios ion-nav > .ion-page > ion-header > .toolbar.statusbar-padding:first-child, | |
| .ios ion-tab > .ion-page > .toolbar.statusbar-padding:first-child, | |
| .ios ion-tab > .ion-page > ion-header > .toolbar.statusbar-padding:first-child, | |
| .ios ion-tabs > .ion-page.tab-subpage > ion-header > .toolbar.statusbar-padding:first-child, | |
| .ios ion-menu > .menu-inner > .toolbar.statusbar-padding:first-child, | |
| .ios ion-menu > .menu-inner > ion-header > .toolbar.statusbar-padding:first-child { | |
| padding-top: calc(20px + 4px) !important; |
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
| <?php | |
| namespace Src\Csv; | |
| use Illuminate\Http\Response; | |
| use Symfony\Component\HttpFoundation\StreamedResponse; | |
| /** | |
| * Class DownloadLargeCsv | |
| * |
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
| // This will open up a prompt for text to send to a console session on digital ocean | |
| // Useful for long passwords | |
| (function () { | |
| window.sendString = function (str) { | |
| f(str.split("")); | |
| function f(t) { | |
| var character = t.shift(); | |
| var i=[]; | |
| var code = character.charCodeAt(); | |
| var needs_shift = character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/); |
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
| <?php | |
| namespace Tests\Concerns; | |
| use App\Models\User; | |
| use Tymon\JWTAuth\Facades\JWTAuth; | |
| trait AttachJwtToken | |
| { | |
| /** |
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
| #!/bin/sh | |
| EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) | |
| php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
| ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") | |
| if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] | |
| then | |
| >&2 echo 'ERROR: Invalid installer signature' | |
| rm composer-setup.php |
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
| import random | |
| import math | |
| import timeit | |
| import matplotlib.pyplot as plt | |
| timeBubble = [] | |
| timeSelection = [] | |
| timeInsertion = [] | |
| timeQuick = [] | |
| timeMerge = [] |
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
| <snippet> | |
| <content><![CDATA[ | |
| \$this-> | |
| ]]></content> | |
| <tabTrigger>$</tabTrigger> | |
| <scope>embedding.php, meta.embedded.block.php, source.php, meta.class.php, meta.block.php, meta.function.php, meta.block.php</scope> | |
| </snippet> |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Simple Backbone WordPress Example</title> | |
| <link rel="stylesheet" href="base.css"> | |
| </head> | |
| <body> | |
| <ul id="post-list"></ul> |
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
| #!/bin/bash -e | |
| # wait-for-postgres.sh | |
| # Adapted from https://docs.docker.com/compose/startup-order/ | |
| # Expects the necessary PG* variables. | |
| until psql -c '\l'; do | |
| echo >&2 "$(date +%Y%m%dt%H%M%S) Postgres is unavailable - sleeping" | |
| sleep 1 | |
| done |