Skip to content

Instantly share code, notes, and snippets.

:octocat:
Code Gardening

Mihail Szabolcs icebreaker

:octocat:
Code Gardening
View GitHub Profile
@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
View keybase.md

Keybase proof

I hereby claim:

  • I am icebreaker on github.
  • I am c0d3rguy (https://keybase.io/c0d3rguy) on keybase.
  • I have a public key ASAmfJzXMO9qaDWrV88bAo3FJpQkRbNPSPzLykK5sSEt7Qo

To claim this, I am signing this object:

@icebreaker
icebreaker / threads.h
Created May 19, 2019 — forked from yohhoy/threads.h
C11 <threads.h> emulation library
View threads.h
/*
* 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 Oct 30, 2017 — forked from marcoshack/extract_JavaForMacOSX10_5Update10.sh
Extract Java JDK 1.5 from JavaForMacOSX10.5Update10.dmg (original Apple distribution)
View extract_JavaForMacOSX10_5Update10.sh
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/
View gist:3d11d13249c0f00de2b6ef522091e462
# 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
@icebreaker
icebreaker / output.txt
Created Nov 15, 2016
weird clang++ / g++ behavior
View output.txt
$ clang++ -O0 test1.cpp test2.cpp -o simple; ./simple
destructor 1
destructor 1
$ clang++ -O1 test1.cpp test2.cpp -o simple; ./simple
destructor 1
destructor 1
$ clang++ -O2 test1.cpp test2.cpp -o simple; ./simple
destructor 1
destructor 2
$ clang++ -O3 test1.cpp test2.cpp -o simple; ./simple
View ruby_emoji.rb
#!/usr/bin/env ruby
def ✉️
puts ✉️
end
def
end
@icebreaker
icebreaker / uri_extract.rb
Created Aug 9, 2016
Unexpected URI.extract()
View uri_extract.rb
>> require 'uri'
>> URI.extract('hello world test: https://helloworld.com test')
=> ["test:", "https://helloworld.com"]
@icebreaker
icebreaker / nyan.c
Last active Apr 13, 2016
nyan.c - IOCCC warm-up
View nyan.c
#include <stdio.h>
#include <unistd.h>
int main(){const char *O_o[]=/*msz*/{
" ,------,\n" "v| /\\__/\\ \n"
" |__( ^ w ^) \n" " \" \"\n",
" ,------,\n"
"~| /\\__/\\\n"
" |___( ^ w ^) \n"
" \" \"\n",
View chasm.txt
L#k>L#0
WjZj
Wi>L#
L#i>L#
F#i>L#
L#u
k>L#0
Wk>L#
Wi>L#
6.#h
You can’t perform that action at this time.