Skip to content

Instantly share code, notes, and snippets.

View ericoporto's full-sized avatar
🎮
making

Érico Porto ericoporto

🎮
making
View GitHub Profile
@ericoporto
ericoporto / Dark.md
Created October 8, 2022 16:12 — forked from rounk-ctrl/Dark.md
Win32 Dark Mode

Dark Mode APIs.

API Signatures.

ShouldAppsUseDarkMode()

Checks whether system is using dark mode or not.
Signature:

using fnShouldAppsUseDarkMode = bool (WINAPI*)(); // ordinal 132

AllowDarkModeForWindow(In HWND hWnd, In bool allow)

Introduction

Here are some rough notes on building Kirikiri SDL2 for iOS and Android.
Please note that these may or may not be incomplete. Improved documentation is being planned, but not started yet.

Startup Directory selection

Since Android and iOS don't really have concepts of "current directory" or "command line arguments", you should probably hardcode the startup directory in TVPBeforeSystemInit in src/core/base/sdl2/SysInitImpl.cpp.

Android is still a work in progress. You may be able to use file://?/ to access the Android assets folder, but this is untested.

@ericoporto
ericoporto / 1.Instructions.md
Created October 19, 2020 02:10 — forked from WesThorburn/1.Instructions.md
Linux: Compile C++ to WebAssembly and JavaScript using Emscripten and CMake

Linux: Compile C++ to WebAssembly and JavaScript using Emscripten and CMake

Download and Install Emscripten

  • My preferred installation location is /home/user
  • Get the latest sdk: git clone https://github.com/emscripten-core/emsdk.git
  • Enter the cloned directory: cd emsdk
  • Install the lastest sdk tools: ./emsdk install latest
  • Activate the latest sdk tools: ./emsdk activate latest
  • Activate path variables: source ./emsdk_env.sh
  • Configure emsdk in your bash profile by running: echo 'source "/home/user/emsdk/emsdk_env.sh"' >> $HOME/.bash_profile
@ericoporto
ericoporto / making_language_grammar.md
Created June 26, 2020 10:39 — forked from Aerijo/making_language_grammar.md
Guide to writing an Atom language grammar

A guide to writing a language grammar (TextMate) in Atom

Tree sitter

  • Atom is transitioning to an entirely new way of defining grammars using tree-sitter. This will be enabled by default quite soon now. It is theoretically faster and more powerful than regex based grammars (the one described in this guide), but requires a steeper learning curve. My understanding is that regex based grammars will still be supported however (at least until version 2), so this guide can still be useful. To enable it yourself, go to Settings -> Core and check Use Tree Sitter Parsers

Links for tree-sitter help:

@ericoporto
ericoporto / keepingForkUpToDate.md
Last active February 7, 2020 21:06 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

Note: I use ssh keys with git instead of https.

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo

git remote add upstream git@github.com:ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git

@ericoporto
ericoporto / ImGuiUtils.h
Created January 6, 2020 15:40 — forked from dougbinks/ImGuiUtils.h
ImGuiUtils.h with TextURL
#pragma once
#include "RuntimeImGui.h"
#include "RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE;
#include "IconsFontAwesome.h" // from https://github.com/juliettef/IconFontCppHeaders
#include "PlatformUtils.h"
namespace ImGui
@ericoporto
ericoporto / gist:1eb5f65d733233daef0184971bd3c6a9
Created June 6, 2019 15:55 — forked from Cysu/gist:7461066
Python: PyQt- FlowLayout
#! /usr/bin/python2
# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
class FlowLayout(QtGui.QLayout):
def __init__(self, parent=None, margin=0, spacing=-1):
super(FlowLayout, self).__init__(parent)
if parent is not None:
@ericoporto
ericoporto / Generate Normal Map.lua
Created March 10, 2019 02:29 — forked from ruccho/Generate Normal Map.lua
Lua script for Aseprite that generates normal map automatically.
----------------------------------------------------------------------
-- Generate Normal Map
--
-- It works only for RGB color mode.
----------------------------------------------------------------------
if app.apiVersion < 1 then
return app.alert("This script requires Aseprite v1.2.10-beta3")
end

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: git@github.com/myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo.

How do I add images to a wiki page?

You need to clone the wiki repo and edit it on your system.

@ericoporto
ericoporto / github-to-bitbucket
Created February 10, 2018 02:32 — forked from sangeeths/github-to-bitbucket
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v