Skip to content

Instantly share code, notes, and snippets.

View mfdeveloper's full-sized avatar
🕹️
Creating games and mobile apps, every day!

Felipe Michel mfdeveloper

🕹️
Creating games and mobile apps, every day!
View GitHub Profile
@mfdeveloper
mfdeveloper / ArrayExtensions.swift
Created April 10, 2020 12:01
Swift 5 extension to convert an array into two dimensions in format: [ [ ],[ ] ]. It is good for mount two collumns grid/list
import Foundation
extension Array {
/**
Transform an array in another array with 2 (two) dimensions
in format: `[ [ ],[ ] ]`
# Example
@mfdeveloper
mfdeveloper / SystemImageView.swift
Created April 9, 2020 00:01
SwiftUI: Renders a system image, and a text. Pass a custom size to the SF Symbol like a font size in IOS 13+
VStack {
Image(systemName: "photo.fill")
// Images SF symbols contains sizes like text fonts
.font(.system(size: 60, weight: .bold))
.padding(10)
Text("Error: Image not loaded :(")
.font(.title)
}
@mfdeveloper
mfdeveloper / ContentView.swift
Created April 7, 2020 00:35
SwiftUI code snippet example with a Custom View inside in another custom view (InnerContentView => ContentView)
//
// ContentView.swift
// FlickrImages
//
// Created by Felipe on 27/03/2020.
// Copyright © 2020 darkness. All rights reserved.
//
import SwiftUI
@mfdeveloper
mfdeveloper / README.md
Last active April 2, 2020 18:31
A Markdown README example with "retractile/dropdown" sections

Basic example

In Objective-C
// You can put a Objective-C example here
@mfdeveloper
mfdeveloper / index.js
Created December 8, 2019 15:46
Webpack: How to load non module scripts into global scope | window
// Import or require the module to includes global variables from the lib
import "p5.scenemanager"
public class Perguntas {
public static String csvToQuery(Context context, String fileName) throws IOException {
InputStream stream = context.getAssets().open(fileName);
return csvToQuery(stream);
}
public static String csvToQuery(InputStream stream) throws IOException {
@mfdeveloper
mfdeveloper / AndroidManifest.xml
Created August 21, 2019 20:26
This is a git snippets to configure your Android project to run UI Tests without animations, using Cappuccino library
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="br.gov.fazenda.receita.pessoafisica"
android:installLocation="auto">
<!-- Disable animations on debug builds so that the animations do not interfere with Espresso
tests. Adding this permission to the manifest is not sufficient - you must also grant the
permission over adb! -->
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE" />
// This is a working .gradle file for cordova-plugin-fcm-with-updated plugin,
// to use with cordova-android 6.3.0
def FCM_CORE_VERSION = System.getenv("FCM_CORE_VERSION") ?: '16.0.9'
def FCM_VERSION = System.getenv("FCM_VERSION") ?: '18.0.0'
buildscript {
repositories {
mavenCentral()
jcenter()
public class AndroidWebview extends CordovaWebView {
/**
* Use webview.sendJavascript is deprecated in latest cordova-android
* Insteadof, pass a JS callback like a success function in cordova.exec()
* cordova plugin JS Bridge, and execute a callbackContext.sendPluginResult(result);
* in Java.
*
* Use this, only if you wish call JS from Java webview/cordova app in old

Composer PHP: Wordpress plugin local path

To reference to a local path reference to a wordpress plugin, using Composer, you need do:

In your WP project/source

  1. Add a repository pointing to local path (absolute or relative) like the composer.json

  2. Add a installer-paths key to move to a specific folder when install the plugin, only if the target plugin contains contains a composer.json with type "wordpress-plugin"