Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Code Gardening

Mihail Szabolcs icebreaker

:octocat:
Code Gardening
View GitHub Profile
View MyApp.Publishing.APICaller.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<events>
<event name="publish:end:remote">
<handler type="MyApp.Publishing.APICaller, MyApp.Publishing" method="CallAPIMethod" />
</event>
</events>
</sitecore>
</configuration>
View MyApp.Publishing.APICaller.cs
using Sitecore.Caching;
using Sitecore.Caching.Generics;
using Sitecore.Configuration;
using Sitecore.Diagnostics;
using Sitecore.Sites;
using System;
using System.Collections;
namespace MyApp.Publishing
{
@icebreaker
icebreaker / GlslSobel.frag
Created Dec 21, 2021 — forked from Hebali/GlslSobel.frag
GLSL Fragment Shader: Sobel Edge Detection
View GlslSobel.frag
// Sobel Edge Detection Filter
// GLSL Fragment Shader
// Implementation by Patrick Hebron
uniform sampler2D texture;
uniform float width;
uniform float height;
void make_kernel(inout vec4 n[9], sampler2D tex, vec2 coord)
{
@icebreaker
icebreaker / ConvertToObj.cs
Created Aug 30, 2021 — forked from NewEXE/ConvertToObj.cs
Export Unity Game Objects to Wavefront OBJ
View ConvertToObj.cs
// On the basis: https://forum.unity.com/threads/export-obj-while-runtime.252262/
// How to use:
// Put file to Assets/Editor folder
// then select GameObject -> Export selected objects
// in Unity's main panel.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
View gist:036222048ce7501393cdd810539d6893
UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 CC BY
The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.
@icebreaker
icebreaker / non_blocking_popen.lua
Created May 30, 2021 — forked from max1220/non_blocking_popen.lua
non-blocking popen for Lua(using ffi)
View non_blocking_popen.lua
-- Implements a basic binding for popen that allows non-blocking reads
-- returned "file" table only supports :read(with an optional size argument, no mode etc.) and :close
local function non_blocking_popen(cmd, read_buffer_size)
local ffi = require("ffi")
-- C functions that we need
ffi.cdef([[
void* popen(const char* cmd, const char* mode);
int pclose(void* stream);
int fileno(void* stream);
@icebreaker
icebreaker / nvidia_340.108_4_8_kernel.patch
Last active Nov 19, 2020
Patch for the NVIDIA 340.108 (NVIDIA ION, etc) kernel module to make it compilable on new kernels (4.8 and later)
View nvidia_340.108_4_8_kernel.patch
--- kernel/uvm/nvidia_uvm_lite.c 2019-12-12 00:04:24.000000000 +0200
+++ kernel/uvm/nvidia_uvm_lite.c 2020-11-19 02:15:59.338918014 +0200
@@ -820,7 +820,7 @@
}
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
-int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+vm_fault_t _fault(struct vm_fault *vmf)
{
#if defined(NV_VM_FAULT_HAS_ADDRESS)
@icebreaker
icebreaker / star-wars-planets.html
Created Nov 9, 2020 — forked from richard-flosi/star-wars-planets.html
Web Component using Custom Element, Shadow DOM, fetch, async/await, and the Star Wars API
View star-wars-planets.html
<html>
<head>
<script>
customElements.define("star-wars-planets", class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open" });
}
static get observedAttributes() { return ["loading", "planets"]; }
@icebreaker
icebreaker / install-arch.md
Created Oct 21, 2020 — forked from mjnaderi/install-arch.md
Install Arch Linux with Full Disk Encryption (LVM on LUKS)
View install-arch.md
@icebreaker
icebreaker / gpu.cpp
Created Apr 24, 2020 — forked from statico/gpu.cpp
Trick to tell AMD and Nvidia drivers to use the most powerful GPU instead of a lower-performance (such as integrated) GPU
View gpu.cpp
#ifdef _WIN32
// Use discrete GPU by default.
extern "C" {
// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
// http://developer.amd.com/community/blog/2015/10/02/amd-enduro-system-for-developers/
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
#endif