Skip to content

Instantly share code, notes, and snippets.

View icebreaker's full-sized avatar
👽
Code gardening!

Mihail Szabolcs icebreaker

👽
Code gardening!
View GitHub Profile
@icebreaker
icebreaker / GlslSobel.frag
Created December 21, 2021 19:18 — forked from Hebali/GlslSobel.frag
GLSL Fragment Shader: Sobel Edge Detection
// 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 August 30, 2021 17:06 — forked from NewEXE/ConvertToObj.cs
Export Unity Game Objects to Wavefront OBJ
// 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;
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 23:44 — forked from max1220/non_blocking_popen.lua
non-blocking popen for Lua(using ffi)
-- 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 / star-wars-planets.html
Created November 9, 2020 12:06 — forked from richard-flosi/star-wars-planets.html
Web Component using Custom Element, Shadow DOM, fetch, async/await, and the Star Wars API
<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 October 21, 2020 10:16 — forked from mjnaderi/install-arch.md
Install Arch Linux with Full Disk Encryption (LVM on LUKS)
@icebreaker
icebreaker / gpu.cpp
Created April 24, 2020 09:59 — 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
#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
@icebreaker
icebreaker / threads.h
Created May 19, 2019 14:08 — forked from yohhoy/threads.h
C11 <threads.h> emulation library
/*
* C11 <threads.h> emulation library
*
* (C) Copyright yohhoy 2012.
* Distributed under the Boost Software License, Version 1.0.
* (See copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef EMULATED_THREADS_H_INCLUDED_
#define EMULATED_THREADS_H_INCLUDED_
@icebreaker
icebreaker / extract_JavaForMacOSX10_5Update10.sh
Created October 30, 2017 10:57 — forked from marcoshack/extract_JavaForMacOSX10_5Update10.sh
Extract Java JDK 1.5 from JavaForMacOSX10.5Update10.dmg (original Apple distribution)
cd ~/Downloads
wget http://support.apple.com/downloads/DL1359/en_US/JavaForMacOSX10.5Update10.dmg \
-O ~/Downloads/JavaForMacOSX10.5Update10.dmg
hdiutil attach ~/Downloads/JavaForMacOSX10.5Update10.dmg
pkgutil --expand /Volumes/Java\ For\ Mac\ OS\ X\ 10.5\ Update\ 10/JavaForMacOSX10.5Update10.pkg \
~/Downloads/JavaForMacOSX10.5Update10
cd ~/Downloads/JavaForMacOSX10.5Update10/JavaForMacOSX10.5Update10.pkg/
@icebreaker
icebreaker / gist:3d11d13249c0f00de2b6ef522091e462
Created September 21, 2017 11:51 — forked from PVince81/gist:63800bffd437f2175da9
build-sdl2-for-torchlight.sh
# set this to your Torchlight directory
TORCHLIGHTDIR=$HOME/games/Torchlight
hg clone http://hg.libsdl.org/SDL
# check out the revision before the one that introduces the bug as advised here: http://forums.runicgames.com/viewtopic.php?f=24&t=33360&start=60#p474739
hg up 4de584a3a027 --clean
# Fix X11 compilation issues with another changeset
hg export 6caad66a4966 > patch
hg import patch