Skip to content

Instantly share code, notes, and snippets.

View attilam's full-sized avatar

Attila Malarik attilam

View GitHub Profile
@attilam
attilam / rs_mat.py
Last active June 5, 2023 06:44
Houdini Shelf Tool to enable the albedo texture of Quixel Bridge RedShift materials in the OGL viewport
for node in hou.selectedNodes():
if (node.type().name() != "redshift_vopnet"): continue
ptg = node.parmTemplateGroup()
folder = ptg.findFolder("RS Mat")
if (folder): continue
node.layoutChildren()
let spn = document.getElementsByTagName('span')
let t, i, b
let res = ''
for(let s of spn) {
let a = 0
let cn = s.childNodes
while(a < cn.length) {
let node = cn[a]
switch(node.nodeName) {
const Parser = require('fast-xml-parser')
const he = require('he')
const createCsvWriter = require('csv-writer').createObjectCsvWriter
const fs = require('fs')
const xmlFile = fs.readFileSync('../../../Downloads/folkets_sv_en_public.xml', 'utf-8')
const options = {
attributeNamePrefix: '@_',
attrNodeName: false, // default is 'false'
@attilam
attilam / CreateLegacyAnimationClip.cs
Created December 6, 2018 19:37
Create Legacy AnimationClips using the Asset Menu in Unity
using System.IO;
using UnityEditor;
using UnityEngine;
public class CreateLegacyAnimationClip {
[MenuItem("Assets/Create/Animation (Legacy)", false, 402)]
public static void CreateIt()
{
AnimationClip clip = new AnimationClip();
@attilam
attilam / mail.google.com.css
Created October 19, 2018 13:36
My Stylus CSS tweaks
.th td {
padding: 8px 6px;
font-weight: bold;
}
.ts {
color: #006;
}
; AutoHotkey script to get Accented characters
; character codes from https://unicodelookup.com/
; and https://www.fileformat.info/info/unicode/char/search.htm
#SingleInstance, force
#Hotstring * ? ; Expand immediately everywhere
; á
@attilam
attilam / rotonde_simple.php
Last active June 23, 2017 05:53
Small php script to serve rotonde json feeds
<?php
header("Access-Control-Allow-Origin: *");
header('Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"');
$profile = array(
"name" => "Attila Malarik",
"location" => "Rainy Budakeszi",
"color" => "#8872FF",
"avatar" => "http://rotonde.attilam.com/Rubinstein.png"
);
@attilam
attilam / share.sh
Last active February 16, 2017 06:34
Upload file to shared folder on site (replacing spaces with _ in filename), copy URL to clipboard, display notification.
#!/usr/bin/env bash
fname=$(basename -a -s $1)
underscore=${fname//[[:space:]]/_}
targetname="http://attilam.com/shared/$underscore"
curl -s -n -T "$1" ftp://attilam.com/public_html/shared/$underscore
echo -n $targetname | pbcopy
osascript -e "display notification \"$targetname\" with title \"File uploaded.\""
@attilam
attilam / FittedBoxCollider.cs
Created October 24, 2013 08:05
Small Unity3D editor script that will create a BoxCollider that encapsulates all Renderers in the selected Transform's hierarchy.
using UnityEngine;
using UnityEditor;
using System.Collections;
public class FittedBoxCollider {
[MenuItem("GameObject/Create Other/Create Fitted BoxCollider")]
static void FittedBoxColliderMenu() {
Transform transform = Selection.activeTransform;
Quaternion rotation = transform.rotation;
transform.rotation = Quaternion.identity;
@attilam
attilam / DynamicEvent.cs
Created September 15, 2013 09:08
Stupid little class to fit all sorts of functionality into one place as possible, to be used in an interactive environment (I'm not proud of it, but pressed on time it's proven very helpful)
using UnityEngine;
using Holoville.HOTween;
[System.Serializable]
public class DynamicEvent {
[System.Serializable]
public class AnimationSetup {
public GameObject gameObject;
public string animation;
}