Skip to content

Instantly share code, notes, and snippets.

View rgarat's full-sized avatar

Ruben Garat rgarat

View GitHub Profile
@rgarat
rgarat / FixCultureEditor.cs
Created June 6, 2019 19:12
Hack to force InvariantCulture
using System.Globalization;
using System.Threading;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
#if UNITY_EDITOR
[InitializeOnLoad]
public static class FixCultureEditor
@rgarat
rgarat / TextureAssetConfigurer.cs
Created August 30, 2017 19:31
TextureAssetConfigurer assetpostprocessor to define import settings automatically
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
using System;
public class TextureAssetConfigurer : AssetPostprocessor {
[Serializable]
@rgarat
rgarat / LinkAssetsFolderConfigurer.java
Created October 24, 2012 17:49
LinkDirInm2e-android
package me.gladwell.eclipse.m2e.android.configuration;
import java.util.List;
import org.apache.maven.model.Plugin;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
@rgarat
rgarat / LinkDir.java
Created October 24, 2012 15:48
LinkDirInEclipse
IProject project = request.getProject();
IFolder link = project.getFolder("assets");
IPath location = new Path(assetsDir);
if (workspace.validateLinkLocation(link, location).isOK()) {
try {
link.createLink(location, IResource.NONE, null);
} catch (CoreException e) {
throw new RuntimeException(e);
}
@rgarat
rgarat / googleanalyticsdomainhash.java
Created June 7, 2011 23:43
Google analytics domain hash
public class googleanalyticsdomainhash {
public static void main(String[] args) {
comparehash(null, 1);
comparehash("blog.gemserk.com", 244902742);
comparehash("www.tv.com", 141309943);
comparehash("www.teamliquid.net", 30386106);
}
public static void comparehash(String domain, int hash) {