Skip to content

Instantly share code, notes, and snippets.

View v1993's full-sized avatar
🌋
Learning Vulkan and modern OpenGL

Valeri v1993

🌋
Learning Vulkan and modern OpenGL
  • Russia
  • 04:16 (UTC +03:00)
View GitHub Profile
@v1993
v1993 / readiter.lua
Created April 3, 2016 13:18
Small lua code to read file using for with iterator
readiter = function(h, size)
return function()
return h:read(size)
end;
end;
--[[
Using: for var in readiter(fileh, size) do your_code end
size -- one of supported formats to file:read()
file -- vaule getted using io.open(filename, 'r') -- read mode required!
]]--
@v1993
v1993 / README.md
Last active May 2, 2018 15:04
RoundedBox node for Cocos2d-x (tested on 3.16)
@v1993
v1993 / cocos-build-android
Created July 5, 2018 10:09
My build script for cocos2d-x. It should work on any posix system. posix lua module is required, ansicolors is required for colorful output.
#!/usr/bin/lua
local AVD_BINARY = '/home/v/compile/android-sdk-linux/tools/qemu/linux-x86_64/qemu-system-x86_64'
local ADB_BINARY = '/home/v/compile/android-sdk-linux/platform-tools/adb'
-- I know, hardcoding is bad, but any other way is too expensive :-(
local colors
do
local ok
@v1993
v1993 / README.md
Created August 25, 2018 17:15 — forked from mw-ferretti/README.md
Paypal button on markdown github

Steps:

<!-- Sample of code generated --> 
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="RGQ8NSYPA59FL">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/pt_BR/i/scr/pixel.gif" width="1" height="1">
@v1993
v1993 / valgrind.txt
Created September 22, 2018 16:05
Valgrind on glade
v@v-xubuntu:~/compile/tld_calc$ valgrind glade
==9781== Memcheck, a memory error detector
==9781== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==9781== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==9781== Command: glade
==9781==
GladeUI-Message: 18:51:45.168: 1 missing displayable value for GtkWidget::events
GladeUI-Message: 18:51:45.205: 1 missing displayable value for GtkWidget::AtkObject::accessible-role
GladeUI-Message: 18:51:47.372: 2 missing displayable value for GtkEntry::input-hints
GladeUI-Message: 18:51:51.143: No displayable values for property GtkMenu::anchor-hints
@v1993
v1993 / stk-update
Last active October 31, 2018 23:59
Simple STK git updater
#!/bin/bash
assetstriger=false
codetriger=false
compiler=g++
. /etc/stk-update
startupdate(){
if zenity --question --title=SuperTuxKart --text='Есть обновления SuperTuxKart. Поставить?' --icon-name=supertuxkart --ok-label=Поставить --cancel-label=Потом --modal
then
BUILD_DIR="$BASEDIR"/stk-code/cmake_build
@v1993
v1993 / stk.crash
Created October 19, 2018 15:25
Crash (in other person friends view) in stk
#0 0x0000000000a3cbf4 in OnlineProfileFriends::compareFriends(int, int) ()
#1 0x0000000000a3e1fe in void std::__final_insertion_sort<__gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int> > >, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)> >(__gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int> > >, __gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int> > >, __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>) ()
#2 0x0000000000a3b971 in OnlineProfileFriends::displayResults() ()
#3 0x00000000007fee88 in GUIEngine::render(float) ()
#4 0x0000000000758bb4 in IrrDriver::update(float) ()
#5 0x00000000008f115b in MainLoop::run() ()
#6 0x00000000008ed691 in main ()
@v1993
v1993 / crash
Created October 30, 2018 00:50
#0 0x000000000097e469 in std::pair<irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> >, irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> > >::pair<irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> >, irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> >, true>(irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> > const&, irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> > const&) ()
#1 0x000000000097e2c8 in void std::vector<std::pair<irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> >, irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> > >, std::allocator<std::pair<irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> >, irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> > > > >::_M_realloc_insert<irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> > const&, irr::core::string<wchar_t, irr::core::irrAllocator<wchar_t> > const&>(__gnu_cxx::__normal_iterator<std::pair<irr::core::string<wchar_t, irr::core::irrAllo
// Show image using dots and spaces in terminal
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#include <iostream>
int main(int argc, char *argv[]) {
if (argc != 2) { std::cerr << "Only one argument should be image file" << std::endl; return 1; };
int x, y, n;
unsigned char *data = stbi_load(argv[1], &x, &y, &n, 1);
@v1993
v1993 / FindGLSLang.cmake
Created March 9, 2019 12:56
CMake module to find GLSLang (WIP, will be moved to github repo later)
set(_GLSLang_Include_Path "")
set(_GLSLang_Library_Path "")
set(_GLSLang_Components_Found "")
function(_GLSLang_Add_Component COMPONENT)
list(APPEND _GLSLang_Components_Found ${COMPONENT})
endfunction()
if(WIN32)