Skip to content

Instantly share code, notes, and snippets.

View Ali-RS's full-sized avatar

Ali-RS Ali-RS

View GitHub Profile
@jcfandino
jcfandino / TestTexturePickApp.java
Created January 6, 2022 17:18
Picking texture pixel with a ray cast
package com.example;
import com.jme3.app.SimpleApplication;
import com.jme3.asset.plugins.ClasspathLocator;
import com.jme3.collision.CollisionResult;
import com.jme3.collision.CollisionResults;
import com.jme3.font.BitmapText;
import com.jme3.light.AmbientLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
@davidB
davidB / bintray-sync.bash
Last active February 10, 2021 14:21
a script to batch request sync from bintray/JCenter into maven central
#! /bin/bash
#
# for manual or api sync prerequirements are the same:
# - on oss sonatype:
# - having an account on https://issues.sonatype.org/
# - being allowed to publish to the target groupId
# - check on that stagingProfiles includes the target groupId on https://oss.sonatype.org/#stagingProfiles (same user/password as on https://issues.sonatype.org/) that
# - on bintray
# - artifacts available on JCenter (request require manual approbation from bintray)
# - artifacts follow [requirements](http://central.sonatype.org/pages/requirements.html)
@jayfella
jayfella / TestVlcPlayer4.java
Last active October 10, 2021 08:19
Playing videos in jMonkeyEngine using VLC4J4
// compile group: 'uk.co.caprica', name: 'vlcj', version: '4.1.0'
package com.jayfella.test;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.material.Materials;
import com.jme3.material.RenderState;
import com.jme3.math.FastMath;
import com.jme3.scene.Geometry;
@jayfella
jayfella / SceneFieldResolver.java
Last active October 19, 2020 15:37
A class that resolves field names to objects from a given Spatial.
package com.jayfella.sdk.resolver;
import com.jme3.light.DirectionalLight;
import com.jme3.light.Light;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.SceneGraphVisitorAdapter;
import com.jme3.scene.Spatial;
/*
Mesh Simplification
(C) by Sven Forstmann in 2014
derived from: https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification
and: https://github.com/timknip/mesh-decimate/blob/master/src/simplify.js
License : MIT
http://opensource.org/licenses/MIT
@oseme-techguy
oseme-techguy / Correct_GnuPG_Permission.sh
Last active April 28, 2024 04:37
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
package com.dongbat.example;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.maps.MapLayer;
@a-m-s
a-m-s / MediaDecoder.java
Last active February 19, 2023 06:54
Android code to extract raw audio from arbitrary media files.
/* MediaDecoder
Author: Andrew Stubbs (based on some examples from the docs)
This class opens a file, reads the first audio channel it finds, and returns raw audio data.
Usage:
MediaDecoder decoder = new MediaDecoder("myfile.m4a");
short[] data;
while ((data = decoder.readShortData()) != null) {
@kra3
kra3 / eq.preset
Created March 26, 2014 12:11
Audacious presets: ~/.config/audacious/eq.preset
[Presets]
Preset0=Classical
Preset1=Club
Preset2=Dance
Preset3=Flat
Preset4=Live
Preset5=Laptop Speakers/Headphone
Preset6=Rock
Preset7=Pop
@simon04
simon04 / gist:6865179
Last active February 15, 2022 06:14
Gradle, Java plugin, Jar MANIFEST, Class-Path is empty

Gradle, Java plugin, Jar MANIFEST, Class-Path is empty

I struggled with with the jar MANIFEST file built with Gradle containing an empty Class-Path. I traced down the problem to the order of the dependencies and jar blocks in the build.gradle file:

Wrong (jar before dependencies):

jar {
    manifest.attributes(