Skip to content

Instantly share code, notes, and snippets.

View juliomarcos's full-sized avatar

Julio Marcos Bortolon Rodrigues juliomarcos

View GitHub Profile
import java.io.FileNotFoundException;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
public class MediaUtils {
/*
* Copyright (C) 2007-2008 OpenIntents.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@juliomarcos
juliomarcos / KeyboardAwareLinearLayout.java
Created March 7, 2015 04:32
Keyboard "Open/Closed Event dispatcher" LinearLayout
package corporation.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
/**
* Created by juliorodrigues on 07/03/15.
*/
public class KeyboardAwareLinearLayout extends LinearLayout {
@juliomarcos
juliomarcos / strings.xml
Created April 22, 2015 18:52
Array de estados do Brasil para usar como resource do Android
<string-array name="ufs">
<item/>
<item>AC</item>
<item>AL</item>
<item>AM</item>
<item>AP</item>
<item>BA</item>
<item>CE</item>
<item>DF</item>
<item>ES</item>
/**
* WIP Simple Todo app
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
ListView,
using CarboLog;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(DropsAnimator))]
public class Arbiter : MonoBehaviour {
const string DROP_TAG = "Drop";
@juliomarcos
juliomarcos / MovingObject.cs
Created July 3, 2018 17:18
2D Roguelike Unity example project interesting snippets
using UnityEngine;
using System.Collections;
namespace Completed
{
//The abstract keyword enables you to create classes and class members that are incomplete and must be implemented in a derived class.
public abstract class MovingObject : MonoBehaviour
{
public float moveTime = 0.1f; //Time it will take object to move, in seconds.
public LayerMask blockingLayer; //Layer on which collision will be checked.
@juliomarcos
juliomarcos / PlayerController.cs
Created July 3, 2018 19:10
Character grid movement using 1 movement input buffering and input filtering delay
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum PlayerState {
Idle,
Moving,
Hit,
Attack,
AttackMove
@juliomarcos
juliomarcos / WaveSpawner.cs
Last active July 18, 2018 05:17
Weighted Enemy Picker / Unity.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using System.Linq;
public enum WaveType {
Annihilation,
Timed,
@juliomarcos
juliomarcos / wireframeOnShaded.mel
Last active July 24, 2019 04:43
wireframeOnShaded MEL script
string $currPanel = `getPanel -withFocus`; // gets current panel with focus
string $panelType = `getPanel -to $currPanel`; // gets the panel type
// this is only applicable to the viewport (modelPanel in MEL's terminology)
if ($panelType == "modelPanel")
{
int $wireOn = `modelEditor -q -wireframeOnShaded $currPanel`; // queries wireframeonShaded state
$wireOn = !$wireOn; // toggles the mode
modelEditor -e -wireframeOnShaded $wireOn $currPanel; // finally sets the new mode
} else {