Skip to content

Instantly share code, notes, and snippets.

@xaguzman
xaguzman / MapChunk - Libgdx Scene2d Actor
Created January 3, 2014 23:55
MapChunk - A libgdx's scene2d Actor that represents a chunk, or area, of a tilemap.
import static com.badlogic.gdx.graphics.g2d.Batch.C1;
import static com.badlogic.gdx.graphics.g2d.Batch.C2;
import static com.badlogic.gdx.graphics.g2d.Batch.C3;
import static com.badlogic.gdx.graphics.g2d.Batch.C4;
import static com.badlogic.gdx.graphics.g2d.Batch.U1;
import static com.badlogic.gdx.graphics.g2d.Batch.U2;
import static com.badlogic.gdx.graphics.g2d.Batch.U3;
import static com.badlogic.gdx.graphics.g2d.Batch.U4;
import static com.badlogic.gdx.graphics.g2d.Batch.V1;
import static com.badlogic.gdx.graphics.g2d.Batch.V2;
@xaguzman
xaguzman / LibgdxTitleBarWindow
Last active August 29, 2015 14:03
Libgdx Scene2dUI Window with title bar
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* 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
@xaguzman
xaguzman / svg_dart_animation.dart
Last active August 29, 2015 14:05
Using dart's universal tween engine to animate svg
// An usage example of the Dart TweenEngine ("tweenengine") library
// Original article:
// http://blog.xavierguzman.com/animating-svg-with-darts-universal-tween-engine/
//
// Dart Tween Engine Library (v 0.10.1)
// PUB: http://pub.dartlang.org/packages/tweenengine
// GITHUB: https://github.com/xaguzman/tween-engine-dart
import 'dart:html';
import 'dart:svg';
@xaguzman
xaguzman / PanZoomCameraInput.java
Created February 19, 2015 05:28
Libgdx - Orthographic Camera Pan & Zoom Input processor
public class PanZoomCameraInput extends InputAdapter {
OrthographicCamera cam;
Vector3 lastTouch, tmp;
public PanZoomCameraInput(OrthographicCamera cam){
this.cam = cam;
lastTouch = new Vector3();
tmp = new Vector3();
}
@xaguzman
xaguzman / IoTDimmer.ino
Last active August 29, 2015 14:25
IoT Campus Party 2015
/*
* IoT Dimmer
*
* This sketch connects to a control site using an Arduino Wiznet
* Ethernet shield and outputs the directed intensity as a binary
* number on pins 5 - 7, where Most Significant bit is 7.
*
* Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
*
@xaguzman
xaguzman / boxstartersetup.txt
Last active May 16, 2019 18:34
Boxstarter setup script for new machines
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableOpenFileExplorerToQuickAccess -EnableExpandToOpenFolder
Disable-GameBarTips
Disable-UAC
Disable-BingSearch
Install-WindowsUpdate
Enable-RemoteDesktop
# cinst googlechrome
cinst filezilla
Import-Module 'C:\tools\poshgit\dahlbyk-posh-git-9bda399\src\posh-git.psd1'
Function SrtToUtf8(){
Param(
[Parameter(Mandatory=$true)] [string] $Path
)
if (Test-Path $Path -PathType Leaf){
Write-Host "Attemping to convert $Path to UTF8"