Skip to content

Instantly share code, notes, and snippets.

View MartinGonzalez's full-sized avatar

Martin Gonzalez MartinGonzalez

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.product">
<application android:icon="@drawable/app_icon" android:label="@string/app_name">
<activity android:name=".OverrideExample" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
@MartinGonzalez
MartinGonzalez / MyAwesomePluginAndroidManifest.xml
Created August 17, 2018 19:25
MyAwesomePluginAndroidManifest
<application>
<meta-data android:name="com.unity.activity.listener.MyHelloWorld"
android:value="com.unity.myhelloworldplugin.MyHelloWorldActivityListener" />
</application>
@MartinGonzalez
MartinGonzalez / Example.cs
Created September 13, 2018 03:06
Snippet Example
public class Example {
public int exampleNumber;
}
@MartinGonzalez
MartinGonzalez / index.js
Last active January 13, 2019 23:05
Download PDF with Google Drive API
const downloadFileAsPdf = (googleDriveFileId) => {
const drive = google.drive({ version: 'v3', auth: 'YOUR_API_KEY' });
const fileStream = fs.createWriteStream('./output.pdf')
drive.files.export({ fileId: googleDriveFileId, mimeType: 'application/pdf' }, { responseType: 'stream' }, (err, res) => {
res.data.pipe(fileStream);
})
}
//https://docs.google.com/presentation/d/HERE_IS_THE_FILE_ID
const slideId = "GOOGLE_DRIVE_FILE_ID"
const fs = require('fs');
const { google } = require('googleapis');
const express = require('express')
const app = express()
const port = 3000
//https://docs.google.com/presentation/d/HERE_IS_THE_FILE_ID
const slideId = "1gieOtIvgm3fm7-WvLdScVPCuVKvwFZVmhEaa39rfOdE"
@MartinGonzalez
MartinGonzalez / ExampleEditorWindow.cs
Created January 21, 2019 00:17
ExampleEditorWindow
void OnGUI() {
// Everything inside BeginHorizontal and EndHorizontal will be distributed horizontally
GUILayout.BeginHorizontal();
GUILayout.Label("Hello");
GUILayout.TextField("World!");
GUILayout.EndHorizontal();
}
@MartinGonzalez
MartinGonzalez / ExampleEditorWindowV2.cs
Created January 21, 2019 00:32
ExampleEditorWindowV2.cs
void OnGUI() {
// Everything inside BeginHorizontal and EndHorizontal will be distributed horizontally
GUILayout.BeginHorizontal();
GUILayout.Label("Hello");
GUILayout.TextField("World!");
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.BeginVertical();
GUILayout.Label("Bool Value");
_toggle = GUILayout.Toggle(_toggle, "");
@MartinGonzalez
MartinGonzalez / ExampleEditorWindowV3.cs
Created January 21, 2019 00:39
ExampleEditorWindowV3
void OnGUI() {
RenderHelloWordRow();
RenderValuesRow();
GUILayout.Label("Another label here");
}
private void RenderHelloWordRow() {
GUILayout.BeginHorizontal();
GUILayout.Label("Hello");
GUILayout.TextField("World!");
@MartinGonzalez
MartinGonzalez / Layout.cs
Created January 21, 2019 00:46
Layout.cs
using System;
using UnityEngine;
public static class Layout {
public static void Horizontal(Action block) {
GUILayout.BeginHorizontal();
block();
GUILayout.EndHorizontal();
}
@MartinGonzalez
MartinGonzalez / ExampleEditorWindowV4.cs
Last active January 21, 2019 01:03
ExampleEditorWindowV4
// Before
private void RenderHelloWordRow() {
GUILayout.BeginHorizontal();
GUILayout.Label("Hello");
GUILayout.TextField("World!");
GUILayout.EndHorizontal();
}
// After
private void RenderHelloWordRow() {