Skip to content

Instantly share code, notes, and snippets.

View ericoporto's full-sized avatar
🎮
making

Érico Porto ericoporto

🎮
making
View GitHub Profile
@WesThorburn
WesThorburn / 1.Instructions.md
Last active March 14, 2024 22:11
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
  • Checkout main: git checkout main
  • Install the lastest sdk tools: ./emsdk install latest
  • Activate the latest sdk tools: ./emsdk activate latest
  • Activate path variables: source ./emsdk_env.sh
@dougbinks
dougbinks / ImGuiUtils.h
Created November 18, 2017 13:53
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

Overview

Our app relies entirely on the current_user helper method (found in our ApplicationController) to retrieve the User object associated with the currently logged-in user (if any). You guys are using the devise gem for authentication, but you still have a current_user helper method which is made available to ApplicationController (and all subclasses).

Normally, the current_user method looks something like this:

def current_user
  # do some magic to get the user id from the (encrypted) session cookie…
 user_id = get_user_id_from_session
@SamDarbonne
SamDarbonne / week1-learning-objectives.md
Last active September 15, 2016 23:37
Week 1 Learning Objectives

Week 1 Learning Objectives

###Git & Github

  • Explain the uses of Git and GitHub for tracking their changes and collaborating on projects.
  • Draw a model of local, remote, and working copies of their repositories.
  • Write some code, commit the changes, and write a strong commit message.
  • Deploy first live website using gh-pages.

###HTML & CSS

@harold-b
harold-b / dear imgui, selectable popup example
Created August 6, 2016 18:39
A functional selectable pseudo-popup window example using dear imgui, for use with autocomplete or input history.
const int ENTRY_COUNT = 10;
const char* ENTRIES[ENTRY_COUNT] =
{
"Entry 0",
"Entry 1",
"Entry 2",
"Entry 3",
"Entry 4",
"Entry 5",

Welcome to Adventure Game Studio! This new Windows Help version of the manual should help you get even more out of AGS. Enjoy!

Copyright and terms of use {#copyright-and-terms-of-use .unnumbered}

Copyright (c) 1999-2011 Chris Jones and 2011-2016 various contributors.

The software is provided under Artistic License 2.0 (http://www.opensource.org/licenses/artistic-license-2.0.php). Adventure

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
typedef struct _lbheader{
unsigned short identifier; // 0x0000
unsigned int filesize; // 0x0002
unsigned int reserved; // 0x0006
@flibitijibibo
flibitijibibo / flibitPackaging.md
Created June 17, 2016 16:00
Hope you like reading ldd output!

A week ago I was CC'd in on a thread about Linux packaging, and how to avoid doing it the wrong way (i.e. RPM, Deb, etc.). I've always used MojoSetup and I've never forced distributions to do any additional work, but this is still a new concept to a lot of people. Additionally, Amos suggested that I expand on Itch's FNA appendix, so here's a guide on how I package my games.

This is a bit of an expansion on my MAGFest 2016 presentation, which you can find here:

http://www.flibitijibibo.com/magfest2016/

https://www.youtube.com/watch?v=B83CWUh0Log

I would recommend looking at that first! After that, read on...

/*
* Arduino Anti-GPS Silliness
* by Connor Nishijima 2016
*
* By reading the frequency of AC cycles in your house using an open analog pin,
* I can tell you for sure what countries you AREN'T in. Pretty god damn useless,
* but fun, nonetheless.
*
* You'll need an Arduino Mega to fit the array of Strings below, Uno doesn't cut it
* even with use of PROGMEM. The Sketch is also written to use the Seeed Studio TFT
@MarcoQin
MarcoQin / ffmpeg_tutorial05.c
Last active October 27, 2023 08:45
ffmpeg tutorial 05 with SDL2 and audio resampling fix
// tutorial05.c
// A pedagogical video player that really works!
//
// Code based on FFplay, Copyright (c) 2003 Fabrice Bellard,
// and a tutorial by Martin Bohme (boehme@inb.uni-luebeckREMOVETHIS.de)
// Tested on Gentoo, CVS version 5/01/07 compiled with GCC 4.1.1
// With updates from https://github.com/chelyaev/ffmpeg-tutorial
// Updates tested on:
// LAVC 54.59.100, LAVF 54.29.104, LSWS 2.1.101, SDL 1.2.15
// on GCC 4.7.2 in Debian February 2015