Skip to content

Instantly share code, notes, and snippets.

View FlightBlaze's full-sized avatar
💭
%display_status%

Blaze FlightBlaze

💭
%display_status%
  • Russia
View GitHub Profile
@paulcuth
paulcuth / instanceof.lua
Last active August 12, 2021 12:40
Implementation of instanceof in Lua
function instanceOf (subject, super)
super = tostring(super)
local mt = getmetatable(subject)
while true do
if mt == nil then return false end
if tostring(mt) == super then return true end
mt = getmetatable(mt)
@paulmoore
paulmoore / Animal.lua
Created December 4, 2011 07:06
A simple Class implementation in Lua for Object-Oriented Programming.
--- Animal.lua
--
-- A simple example of a base class usng the classes library.
--
-- @author PaulMoore
--
-- Copyright (C) 2011 by Strange Ideas Software
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
@tylerneylon
tylerneylon / learn.lua
Last active July 25, 2024 19:50
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@anry200
anry200 / ScalableVideoView.java
Created January 16, 2014 13:40
Android : How to stretch video to use whole area of VideoView (code snippets)
import android.content.Context;
import android.util.AttributeSet;
import android.widget.VideoView;
public class ScalableVideoView extends VideoView {
private int mVideoWidth;
private int mVideoHeight;
private DisplayMode displayMode = DisplayMode.ORIGINAL;
@mstevenson
mstevenson / ConfigurableJointExtensions.cs
Created October 24, 2014 07:14
Extension methods for working with Configurable Joints for Unity
using UnityEngine;
public static class ConfigurableJointExtensions
{
/// <summary>
/// Sets a joint's targetRotation to match a given local rotation.
/// The joint transform's local rotation must be cached on Start and passed into this method.
/// </summary>
public static void SetTargetRotationLocal (this ConfigurableJoint joint, Quaternion targetLocalRotation, Quaternion startLocalRotation)
{
@krazylearner
krazylearner / setup_jdb.md
Last active May 3, 2024 14:12
set up jdb with android

start bluestack or emulator install app on it start the app

connect adb to emulator

$ adb connect localhost:5555

get 'pid' of your app .Dont forget to run it first in emulator

@Gnzlt
Gnzlt / ResourceUtil.java
Created November 2, 2016 14:25
Android utils class to get a Bitmap from a VectorDrawable Resource Id (Took from http://qiita.com/konifar/items/aaff934edbf44e39b04a)
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.VectorDrawable;
import android.os.Build;
import android.support.annotation.DrawableRes;
import android.support.graphics.drawable.VectorDrawableCompat;
@Miouyouyou
Miouyouyou / Linux_DRM_OpenGLES.c
Last active July 14, 2024 05:20
An example, inspired by Rob Clark "kmscube.c" that uses Linux Direct Rendering Manager ( DRM ) and EGL to create an OpenGL ES 2 context. This is a standalone example, that just clears the screen with a blueish color. Usable with Rockchip DRM drivers and Mali Wayland/DRM userspace drivers.
// gcc -o drmgl Linux_DRM_OpenGLES.c `pkg-config --cflags --libs libdrm` -lgbm -lEGL -lGLESv2
/*
* Copyright (c) 2012 Arvin Schnell <arvin.schnell@gmail.com>
* Copyright (c) 2012 Rob Clark <rob@ti.com>
* Copyright (c) 2017 Miouyouyou <Myy> <myy@miouyouyou.fr>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
@tilkinsc
tilkinsc / assimp_opengl_load.c
Created September 8, 2017 08:52
Pure C Assimp model file loading example
VAO* load_model(const char* path) {
// import model
const struct aiScene* scene = aiImportFile(path, aiProcess_Triangulate); // http://assimp.sourceforge.net/lib_html/structai_scene.html
if(scene->mNumMeshes <= 0) {
aiReleaseImport(scene);
return 0;
}
struct aiMesh* mesh = *scene->mMeshes; // http://assimp.sourceforge.net/lib_html/structai_mesh.html
@FlightBlaze
FlightBlaze / about.md
Created September 29, 2018 23:23
Newtoo

README.MD from https://github.com/FlightBlaze/Newtoo

Newtoo

Intelligent & fast web browser engine

Newtoo is the brand new rendering engine for web browsers. Its idea is high perfomance, standard compilance and low memory consumption. It designed to use in web browser Magenta.

Newtoo tries to show a page faster than to load it completely.