Skip to content

Instantly share code, notes, and snippets.

View achimmihca's full-sized avatar

Andreas achimmihca

View GitHub Profile
@tattyd
tattyd / Shadow.cs
Last active February 26, 2026 16:59
Soft shadow control for Unity UI Toolkit
/* MIT License
Copyright (c) 2022 David Tattersall
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@openroomxyz
openroomxyz / LoadTexture2dFromFile.cs
Created April 6, 2020 11:26
Unity : How to load Texture2d from file (PNG) on disk?
private static Texture2D LoadPNG(string filePath)
{
Texture2D tex = null;
byte[] fileData;
if (System.IO.File.Exists(filePath))
{
fileData = System.IO.File.ReadAllBytes(filePath);
tex = new Texture2D(2, 2);
@justincoh
justincoh / handshake_country_language_locale_codes.json
Last active June 23, 2023 20:45
A more robust listing of country codes, language codes, date formats, etc
[
{
"ISO 3166 Country Code": "sqi",
"ISO639-2 Country Code": "AL",
"Country": "Albania",
"ISO639-2 Lang": "sq",
"Locale": "sq-AL",
"Language": "Albanian",
"Date Format": "yyyy-MM-dd",
},
@koraktor
koraktor / RepositoryImpl.java
Created August 18, 2017 10:43
Combining specifications and projections in Spring Data JPA
public class RepositoryImpl<T, ID extends Serializable>
extends SimpleJpaRepository<T, ID extends Serializable> {
ProjectionFactory projectionFactory;
public <P> List<P> findProjected(Specification<?> spec, Sort sort, Class<P> projectionClass) {
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<Tuple> tupleQuery = criteriaBuilder.createTupleQuery();
Root<?> root = tupleQuery.from(getDomainClass());