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
/** | |
* This hook overrides a function check at runtime. Currently, cordova-android 7+ incorrectly detects that we are using | |
* an eclipse style project. This causes a lot of plugins to fail at install time due to paths actually being setup | |
* for an Android Studio project. Some plugins choose to install things into 'platforms/android/libs' which makes | |
* this original function assume it is an ecplise project. | |
*/ | |
module.exports = function(context) { | |
if (context.opts.cordova.platforms.indexOf('android') < 0) { | |
return; | |
} |
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 path = require('path'); | |
exports.handler = (event, context, callback) => { | |
const { request } = event.Records[0].cf; | |
console.log('Request URI: ', request.uri); | |
const parsedPath = path.parse(request.uri); | |
let newUri; |
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
export interface Environment { | |
DEBUG : boolean; | |
API_URL : string; | |
WS_URL : string; | |
BASE_URL : string; | |
} |
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
app/ | |
|- app.module.ts | |
|- app-routing.module.ts | |
|- core/ | |
|- auth/ | |
|- auth.module.ts (optional since Angular 6) | |
|- auth.service.ts | |
|- index.ts | |
|- othermoduleofglobalservice/ | |
|- ui/ |
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 | |
$formData = array("Mike Rosoft", "24637", "[email protected]", "14562342943"); | |
$options = array('valueInputOption' => 'RAW'); | |
$values = [$formData]; | |
$body = new Google_Service_Sheets_ValueRange(['values' => $values]); | |
$append = $this->service->spreadsheets_values->append(SHEET_ID, 'A2:D', $body, $options); |
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
# Gitlab CI - Build Ionic 3 Project and generates apk files | |
image: beevelop/ionic:latest | |
stages: | |
- deploy | |
cache: | |
untracked: true | |
key: "$CI_PROJECT_ID" | |
paths: |
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!@#$%^&*()_+{}:\"<>?~|]/); |