Skip to content

Instantly share code, notes, and snippets.

View valmayaki's full-sized avatar
🤠
Happy to be of service to you!

Valentine Ubani Mayaki valmayaki

🤠
Happy to be of service to you!
View GitHub Profile
@joeljeske
joeljeske / patch-android-studio-check.js
Created April 2, 2018 14:40
Fixes android plugin install that fail because it cannot find AndroidManifest.xml
/**
* 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;
}
@furkan3ayraktar
furkan3ayraktar / LambdaEdgeIndexRedirect.js
Created March 31, 2018 13:44
Redirect requests to index.html within same folder from CloudFront with Labda@Edge.
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;
@tabirkeland
tabirkeland / environment.interface.ts
Last active July 26, 2019 04:33
Ionic 3.9.2 Environment Variables
export interface Environment {
DEBUG : boolean;
API_URL : string;
WS_URL : string;
BASE_URL : string;
}
app/
|- app.module.ts
|- app-routing.module.ts
|- core/
|- auth/
|- auth.module.ts (optional since Angular 6)
|- auth.service.ts
|- index.ts
|- othermoduleofglobalservice/
|- ui/
@DZuz14
DZuz14 / SheetsAppend.php
Created December 31, 2017 16:27
Appending To A Google Sheet Via PHP
<?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);
@lennonjesus
lennonjesus / .gitlab-ci.yml
Created December 7, 2017 16:06
Gitlab CI - Build Ionic 3 Project and generates apk files
# Gitlab CI - Build Ionic 3 Project and generates apk files
image: beevelop/ionic:latest
stages:
- deploy
cache:
untracked: true
key: "$CI_PROJECT_ID"
paths:
@heygrady
heygrady / mapDispatchToProps.md
Last active April 5, 2025 08:11
Redux containers: mapDispatchToProps

Redux containers: mapDispatchToProps

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.

// 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;
@mpijierro
mpijierro / download_csv.php
Last active November 25, 2024 23:52
Example streaming large CSV files with Laravel and thousands of queries
<?php
namespace Src\Csv;
use Illuminate\Http\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
/**
* Class DownloadLargeCsv
*
@byjg
byjg / NoVNC_Paste.js
Last active May 22, 2025 18:30
How to Paste code to NoVNC.
// 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!@#$%^&*()_+{}:\"<>?~|]/);