Skip to content

Instantly share code, notes, and snippets.

View jzeltman's full-sized avatar

Joshua Zeltman jzeltman

View GitHub Profile
@Jagathishrex
Jagathishrex / main.js
Last active February 24, 2023 17:11
converting string to camel case
// util function to convert the input to string type
function convertToString(input) {
if(input) {
if(typeof input === "string") {
return input;
}
@jzeltman
jzeltman / HTL Responsive Images w Lazy Loading
Last active December 6, 2018 20:13
HTL Responsive Images w Lazy Loading for Adobe AEM. Utilizing the lazysizes lazyloading library.
// LazyLoad Library: https://github.com/aFarkas/lazysizes
// Usage
<sly data-sly-use.template="/path/to/template/image.html"
data-sly-call="${ template.imageMarkup @ xsvp=image.xsvpPath, svp=image.svpPath, mvp=image.mvpPath, lvp=image.lvpPath, altText=image.altText, lazyLoad=true }" />
// HTL Template
<template data-sly-template.imageMarkup="${ @ xsvp, svp, mvp, lvp, altText, lazyLoad }">
<picture>
<source media="(max-width: 480px)" data-srcset="${xsvp}" />
@ronyx69
ronyx69 / LightingRebalance.cs
Last active August 7, 2017 15:58
My locally modded lighting and tonemapping settings, fine tuned for vanilla temperate theme and a custom high contrast LUT. http://i.imgur.com/AJ54HWo.png
using ICities;
using System;
using System.Reflection;
using UnityEngine;
namespace LightingRebalance
{
public class LightingRebalanceMod : LoadingExtensionBase, IUserMod
{
public string Name
{
@ronyx69
ronyx69 / PropVariations_AssetEditor.cs
Last active November 29, 2020 07:25
Sets amount of prop variations and calculates equal probability.
//----------------------------------------------------------------
// Prop Variation Amount Changer
//Set amount of prop variations.
//If you are increasing the amount, previous variations will be preserved.
//If decreasing, all variations will be removed!
var variations = 12; //CHANGE THIS
@ronyx69
ronyx69 / TextureReplacer_AssetEditor.cs
Last active May 18, 2017 02:58
Replace textures in real time in asset editor.
// Texture Replacer script by Ronyx69
// ASSET EDITOR, not ingame
// Replaces textures in asset editor in real time!
// Much thanks to SamsamTS for explaining Actions to me and being helpful.
// D, ACI, XYS textures for buildings, props, vehicles and D, XYCA for trees.
// Unfortunately CANNOT replace LOD textures.
// Technically I know how to replace LOD textures,
@jzeltman
jzeltman / gist:7695df31ff24866ce75e
Created April 20, 2015 16:52
jQuery like querySelector(All)
// Returns first element that matches CSS selector {expr}.
// Querying can optionally be restricted to {container}’s descendants
function $(expr, container) {
return typeof expr === "string"? (container || document).querySelector(expr) : expr || null;
}
// Returns all elements that match CSS selector {expr} as an array.
// Querying can optionally be restricted to {container}’s descendants
function $$(expr, container) {
return [].slice.call((container || document).querySelectorAll(expr));
@sebmarkbage
sebmarkbage / react-terminology.md
Last active January 9, 2023 22:47
React (Virtual) DOM Terminology