Skip to content

Instantly share code, notes, and snippets.

View Zingam's full-sized avatar

Hristo Hristov Zingam

  • Roccoor Multimedia
View GitHub Profile
@nikp123
nikp123 / init_window.c
Created May 16, 2021 11:10
Updated "ugly" EGL wayland example to support XDG
// gcc -o test init_window.c -I. -lwayland-client -lwayland-server -lwayland-client-protocol -lwayland-egl -lEGL -lGLESv2
#include <wayland-client-core.h>
#include <wayland-client.h>
#include <wayland-server.h>
#include <wayland-client-protocol.h>
#include <wayland-egl.h> // Wayland EGL MUST be included before EGL headers
#include "xdg-shell-client-protocol.h"
#include "init_window.h"
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 3, 2024 09:53
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
class SomeClass: UIViewController
{
var firstResponder: UIView? /// To handle textField position when keyboard is visible.
var isKeyboardVisible = false /// You can handle tap on view by checking if keyboard is visible.
override func viewDidLoad() {
super.viewDidLoad()
/*
Register notifications for when keyboard appears/disappears
@campenr
campenr / openGL_on_WLSS.md
Created February 17, 2018 00:40
Developing openGL on Ubuntu on the Windows Linux Subsystem
  1. Install Ubuntu through the Windows store

  2. Enable rendering of GUI applications from Ubuntu/WLSS in Windows using a Windows X-server

  • Install VxSrv on Windows
  • On Ubuntu/WLSS open .bashrc and add the following lines to the end, then save file and restart:
# tell GUI display to use the Windows X-server listening on localhost:0.0
export DISPLAY=localhost:0.0
# make rendering happen on the Windows side of things rather than Ubuntu
@mbinna
mbinna / effective_modern_cmake.md
Last active May 3, 2024 15:44
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

set(triple "x86_64-scei-ps4")
set(CMAKE_SYSTEM_NAME "FreeBSD")
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
set(CMAKE_C_COMPILER_AR "ar")
set(CMAKE_LINKER "clang")
set(CMAKE_ASM_COMPILER "clang")
set(CMAKE_FIND_ROOT_PATH "$ENV{PS4SDK}/usr" CACHE STRING "")
@Miouyouyou
Miouyouyou / init_window.c
Created December 15, 2016 07:55
A very ugly Wayland EGL OpenGL example
// gcc -o test init_window.c -I. -lwayland-client -lwayland-server -lwayland-client-protocol -lwayland-egl -lEGL -lGLESv2
#include <wayland-client.h>
#include <wayland-server.h>
#include <wayland-client-protocol.h>
#include <wayland-egl.h> // Wayland EGL MUST be included before EGL headers
#include "init_window.h"
#include "log.h"
#include <string.h>
@evilactually
evilactually / CMakeLists.txt
Created August 8, 2016 21:00
Compiling GLSL to SPIR-V from CMake
if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "AMD64")
set(GLSL_VALIDATOR "$ENV{VULKAN_SDK}/Bin/glslangValidator.exe")
else()
set(GLSL_VALIDATOR "$ENV{VULKAN_SDK}/Bin32/glslangValidator.exe")
endif()
file(GLOB_RECURSE GLSL_SOURCE_FILES
"shaders/*.frag"
"shaders/*.vert"
)
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active February 21, 2024 03:02
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@gmas
gmas / gist:b5fd3d038905d1265485
Created December 25, 2014 22:38
switch gcc versions in debian
#install new versions of gcc and g++
sudo apt-get install gcc-4.8 g++-4.8
#remove existing alternatives
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
#add new and old version to update-alternatives db
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8