Skip to content

Instantly share code, notes, and snippets.

View prnthp's full-sized avatar
👣
i write code when i'm annoyed at things

Pornthep Preechayasomboon prnthp

👣
i write code when i'm annoyed at things
View GitHub Profile
@prnthp
prnthp / pretty_matlab_figures.md
Created March 2, 2020 03:38
How to generate and save vector figures in MATLAB

How to generate and save vector figures in MATLAB

This is how I generate .eps/.pdf/.png files for publications. This will produce nice vector figures and rasters at a nice crispy 300 DPI

Add this to the top of your script

fontname = 'Arial'; % or your favorite font, IEEE prefers Arial in figures. Helvetica is also sexy.
set(0,'DefaultAxesFontName',fontname,'DefaultTextFontName',fontname);
set(0,'DefaultAxesFontSize',8);
@ruzrobert
ruzrobert / Vibration.cs
Last active June 20, 2024 11:29
Android Vibration for Unity 3D. Supports all API: 1 - 29 (auto detect), Amplitudes, Predefined Effects, both Legacy and >=26 APIs.
using System.Diagnostics.CodeAnalysis;
using UnityEngine;
// Dont forget to add "using RDG;" to the top of your script!
namespace RDG
{
/// <summary>
/// Class for controlling Vibration. Automatically initializes before scene is loaded.
/// </summary>
public static class Vibration
global presenterNotes
tell application "Keynote"
activate
open (choose file)
tell front document
do shell script "rm -f ~/keynote-notes.txt"
set num to 0
repeat with aSlide in every slide
set num to num + 1
do shell script "echo '-- " & num & " --' >> ~/keynote-notes.txt"
@louisvalet
louisvalet / Colors
Last active November 17, 2020 09:35
I heard you needed colors
using UnityEngine;
public static class Colors
{
public static readonly Color AbsoluteZero = new Color32( 0, 72, 186, 255 );
public static readonly Color Acajou = new Color32( 76, 47, 39, 255 );
public static readonly Color AcidGreen = new Color32( 176, 191, 26, 255 );
public static readonly Color Aero = new Color32( 124, 185, 232, 255 );
public static readonly Color AeroBlue = new Color32( 201, 255, 229, 255 );
public static readonly Color AfricanViolet = new Color32( 178, 132, 190, 255 );
@LotteMakesStuff
LotteMakesStuff / CustomInspectorCreator.cs
Last active May 23, 2024 22:06
Editor extension that adds a tool to automagically generate boilerplate custom inspector code~ YES! Just drop it into a folder called 'Editor' and it adds a 'custom inspector' option into the Project window!
using UnityEngine;
using UnityEditor;
using System.IO;
public static class CustomInspectorCreator
{
[MenuItem("Assets/Create/Custom Inspector", priority = 81)]
static void CreateInsptorEditorClass()
{
foreach (var script in Selection.objects)