Skip to content

Instantly share code, notes, and snippets.

View glombek's full-sized avatar
🧔‍♂️

Joe Glombek glombek

🧔‍♂️
View GitHub Profile
@glombek
glombek / MinecraftServerInfo.cs
Last active December 16, 2015 20:48 — forked from barneygale/gist:1235274
A class to ping a Minecraft server for its description, player count and maximum player count. Based on barneygale's PHP code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Text.RegularExpressions;
namespace Minecraft
{
public class MinecraftServerInfo
@glombek
glombek / find-flex-elements.js
Created November 30, 2016 14:40
Firefox doesn't like printing pages with flex elements. This script hunts down all elements that are `display: flex`.
$.grep($(':visible'), function(x) { return getComputedStyle(x).getPropertyValue('display') == 'flex' });
-19
+2
+18
+14
-3
-16
+18
-16
-7
-11
@glombek
glombek / USyncMacroAddKeyAttr.ps1
Last active August 19, 2019 08:20
A quick workaround to move all uSync macro keys from a node to an attribute (see https://github.com/KevinJump/uSync/issues/231) - just place in the uSync\data\macro folder and run
# Get all .config files in the current folder
Get-ChildItem "./" -Filter *.config |
Foreach-Object {
[xml]$xml = Get-Content $_.FullName
# Add Key attribute
$macroNode = $xml.SelectSingleNode("macro")
$macroNode.SetAttribute("Key", $xml.macro.Key)
# Remove Key node
@glombek
glombek / set-variant.sql
Last active April 23, 2024 11:11
Set language variant for Umbraco Nested Content properties
-- Set language ID for variant properties where the CMS has not already updated them
BEGIN TRAN;
DECLARE @lang int;
SELECT TOP 1 @lang = id FROM umbracoLanguage;
UPDATE umbracoPropertyData
SET languageId = @lang
WHERE id IN
(SELECT id FROM (
SELECT pd.versionId, pd.propertyTypeId, MAX(pd.languageId) as lang, MAX(pd.id) as id FROM umbracoPropertyData pd
@glombek
glombek / expected-folder.js
Created April 17, 2024 16:33
Similarity app custom script to select a file to mark from each complete grouping
/*
Author: Joe Glombek
Version: 1.1
Description:
Test script
Mark files in the ideal file format we expect.
*/
/// Return the one you want from the complete set of duplicates
function processGroup(currentSet) {