Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexey Gulev AGulev

View GitHub Profile
@Vbif
Vbif / file.cpp
Last active Apr 5, 2021
Defold - auto register enums
View file.cpp
// test compile
typedef double lua_Number;
typedef struct {} lua_State;
void lua_pushnumber (lua_State *L, lua_Number n) {}
void lua_setfield (lua_State *L, int index, const char *k) {}
// test
#include <stdlib.h>
#include <string.h>
View nodeiter.c
typedef struct {
// These fields are internal state and not considered part of the public interface.
Node *parent;
int next_index;
// This field is public and valid to read after a call to next that returns true.
Node *child;
} Iter;
Iter iter_children(Node *node) {
@aglitchman
aglitchman / compile_shader.editor_script
Last active Nov 30, 2021
Editor script for Defold IDE. The script adds the menu items "Compile Fragment Shader" and "Compile Vertex Shader" for .fp/.vp files.
View compile_shader.editor_script
-- Download and install Arm Mobile Studio from
-- https://developer.arm.com/tools-and-software/graphics-and-gaming/arm-mobile-studio/components/mali-offline-compiler
local M = {}
local function ends_with(str, ending)
return ending == "" or str:sub(-#ending) == ending
end
function M.get_commands()
@dapetcu21
dapetcu21 / style-guide.md
Created Apr 27, 2018
Interrogation Style Guide
View style-guide.md

Lua style guide

Linting

This project makes use of [Luacheck] for catching common mistakes. Install it and configure it for your text editor.

Editor configuration

We recommend [Atom] for editing Lua code along with the following packages:

  • [linter-luacheck]: [Luacheck] integration
@Jerakin
Jerakin / builder.py
Last active Jul 9, 2018
For building and deploying Defold projects directly to your phone
View builder.py
"""
Builder is built by wrapping adb and storing some data locally
I would recommend to add an alias to your ~.bash_profile to use it easier
alias builder="python3.5 ~/Documents/repo/builder/builder.py"
Usage:
builder.py [command] [arguments]
Available Commands:
build build [location of a project]
install install [path to APK]
uninstall uninstall [bundle id]
@mathiaswking
mathiaswking / android_deploy.sh
Last active Jun 18, 2019
Deploys an .apk to the USB connected Android device. Starts the app, and grabs the logging events for that PID
View android_deploy.sh
#!/usr/bin/env bash
#set -e
PACKAGE=$1
if [ -z "$PACKAGE" ]; then
echo "You must pass a .apk as input!"
exit 1
fi
@britzl
britzl / bundle.sh
Last active Dec 10, 2020
Script to build and bundle a Defold project for multiple platforms
View bundle.sh
#!/bin/bash
title=$(less game.project | grep "^title = " | cut -d "=" -f2 | sed -e 's/^[[:space:]]*//')
title_no_space=$(echo -e "${title}" | tr -d '[[:space:]]')
echo "Project: ${title}"
if [ ! -f bob.jar ]
then
echo "Unable to find bob.jar. Download it from d.defold.com."
exit 1
@JCash
JCash / make_gif_from_video.sh
Created Jul 17, 2016
A quick way to convert Defold video (.ivf) into a compressed .gif
View make_gif_from_video.sh
#!/usr/bin/env bash
FPS=15
SIZEPX=320
STARTTIME=0
DURATION=0
PALETTE="/tmp/palette.png"
TMPGIF="/tmp/$2"
@t0chas
t0chas / CustomEditorBase.cs
Last active Aug 5, 2022
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
View CustomEditorBase.cs
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
View orthodoxc++.md

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?