Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Back to Android. Kotlin. Webdev. JS. Playing with new frameworks!!

Faisal rasak monsterbrain

🚀
Back to Android. Kotlin. Webdev. JS. Playing with new frameworks!!
View GitHub Profile
@monsterbrain
monsterbrain / custom-shape-layout-android.xml
Created May 23, 2019
Custom Layout - Rectangle with Oval Shape - Android
View custom-shape-layout-android.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/ovalView"
@monsterbrain
monsterbrain / android_progress_dialog_material.java
Created Feb 7, 2019
Simple Code snippet to quickly add a loading dialog for android
View android_progress_dialog_material.java
// in gradle - use compile in old one
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
// Field variable
MaterialDialog progressDialog;
progressDialog = new MaterialDialog.Builder(context)
.title("Loading something")
.content("")
.progress(true, 0) // true for indeterminate
@monsterbrain
monsterbrain / iframe_to_image_conversion_javascript_js_html5.html
Created Feb 7, 2019
iframe is not supported by html2canvas. to convert iframe to image / base64, using iframe2image and html2canvas to save that image data.
View iframe_to_image_conversion_javascript_js_html5.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Canvas to Image Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="html2canvas.js"></script>
View space_invaders_raylibgame.c
/*******************************************************************************************
*
* raylib - sample game: space invaders
*
* Based on Sample game developed by Ian Eito, Albert Martos and Ramon Santamaria
* Modifed by Monster Brain (monsterbraininc.com) - 2018
*
* This game has been created using raylib v1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
@monsterbrain
monsterbrain / shuffle_unity.cs
Created May 17, 2017
Shuffle Array in Unity Code Snippet Script
View shuffle_unity.cs
void reshuffle(string[] texts)
{
// Knuth shuffle algorithm :: courtesy of Wikipedia :)
for (int t = 0; t < texts.Length; t++ )
{
string tmp = texts[t];
int r = Random.Range(t, texts.Length);
texts[t] = texts[r];
texts[r] = tmp;
}
@monsterbrain
monsterbrain / CanvasFaderScript.cs
Created May 16, 2017
A Simple Unity UI Canvas Fading In / Out C# Script. Useful for transitions.
View CanvasFaderScript.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
/*
* A Simple Canvas Fader Script (Unity 5.6)
*
*
* Uses : Fade out or Fade In a UI Canvas. Not for transitioning a whole Scene with elements.
@monsterbrain
monsterbrain / failed to resolve com.hi5dev.box2d_pexml.txt
Last active May 16, 2017
failed to resolve com.hi5dev.box2d_pexml:box2d-pexml android studio LibGDX
View failed to resolve com.hi5dev.box2d_pexml.txt
https://www.codeandweb.com/texturepacker/tutorials/libgdx-physics
Was getting this error. Tried searching.
But at last found that I put the repositaries link
maven { url "https://dl.bintray.com/hi5dev/maven/" }
in the buildscript {} rather than the allprojects {} section.
You can’t perform that action at this time.