Skip to content

Instantly share code, notes, and snippets.

View luisparravicini's full-sized avatar

Luis Parravicini luisparravicini

View GitHub Profile
@luisparravicini
luisparravicini / wordle_solver.js
Last active January 14, 2022 10:26
Simple wordle solver
'use strict';
//
// This script is a simple "assistant" to play wordle.
// It gives you an initial word to enter and then calling a function after each word it will filter the word list
// using the information given by wordle on absent/present/correct letters to narrow down the list.
//
// It doesn't try to help you find the word in the least amount of tries nor anything else. It just filter the possible
// words with the guesses information available at the moment, it just works.
//
@luisparravicini
luisparravicini / colors.rb
Last active December 11, 2020 17:01
small Ruby helper for colorizing output
module Colors
def self.fg_green(io=$stdout)
io.print "\x1b[0;32m"
end
def self.fg_white(io=$stdout)
io.print "\x1b[1;37m"
end
def self.fg_gray(io=$stdout)
@luisparravicini
luisparravicini / GizmosExtensions.cs
Created August 1, 2020 11:23
Method to draw an arc with Unity's Gizmos
using UnityEngine;
public class GizmosExtensions
{
private GizmosExtensions() { }
/// <summary>
/// Draws a wire arc.
/// </summary>
/// <param name="position"></param>
@luisparravicini
luisparravicini / itchio_config
Last active July 17, 2021 17:05
script to upload all the binaries for an itchio project
# The itch.io username
user=REPLACE_WITH_USERNAME
# The project name used for uploading
itchio_project=REPLACE_WITH_PROJECT_NAME
@luisparravicini
luisparravicini / build_all.sh
Last active July 17, 2021 14:41
script for automated Unity project builds
#!/bin/bash
#
# This script creates builds for several platforms for a Unity project.
# It assumes this directory hierarchy:
# base_dir/
# UnityProjectName/
# dist/
# dist/files/
#
@luisparravicini
luisparravicini / anim.sh
Last active April 12, 2020 14:32
ffmpeg options added to make twitter accept the video
#!/bin/bash
#
# Takes a directory of macOS screemshots, label each file with
# a timestamp and creates a video with them.
#
dir=$1
#!/usr/bin/env ruby -W
require 'yaml'
require 'fileutils'
#
# Copies a physics shape from a sprite (reading it's .meta file)
# and aplies the same shape to other sprites.
# Tested only with .meta files created with Unity 2019.1.0f2 and MY
//
// Tries to decode all the files on a certain directory and outputs the result:
// System.out for the files with a qr code
// System.err for the files without a qr code
//
// based on code from https://stackoverflow.com/questions/36210537/find-qr-code-in-image-and-decode-it-using-zxing
//
// needs the ZXing jars from:
// https://oss.sonatype.org/content/repositories/snapshots/com/google/zxing/core/3.3.4-SNAPSHOT/core-3.3.4-20181025.133109-2.jar
// https://oss.sonatype.org/content/repositories/snapshots/com/google/zxing/javase/3.3.4-SNAPSHOT/javase-3.3.4-20181025.133127-2.jar
@luisparravicini
luisparravicini / screenshots.rb
Last active December 21, 2015 11:18
Takes a screenshot every 5 seconds and save the file to a certain folder passed as argument (works on OS X)
#!/usr/bin/env ruby
#
# Takes a screenshot every 5 seconds and save the file to a certain folder passed as argument.
# It uses screencapture, which comes with OS X.
#
#
require 'fileutils'
include FileUtils
@luisparravicini
luisparravicini / copy_assets.rb
Created September 4, 2012 20:58
Combine image assets in different sizes (for iPhone/iPad) into a single directory using cocos2d sufixes
require 'fileutils'
include FileUtils
#
# Copy images from a directory hierarchy like this:
#
# dir/
# 320x480/
# 640x480/
# 1024x768/