Skip to content

Instantly share code, notes, and snippets.

View cassioKenji's full-sized avatar
🙃
I may be slow to respond.

ckoshiro cassioKenji

🙃
I may be slow to respond.
  • 01:25 (UTC -03:00)
View GitHub Profile
@sjvnnings
sjvnnings / better_jumping_character_example.gd
Last active June 25, 2024 21:37
An easy to work with jump in Godot
extends KinematicBody2D
export var move_speed = 200.0
var velocity := Vector2.ZERO
export var jump_height : float
export var jump_time_to_peak : float
export var jump_time_to_descent : float
@bastman
bastman / loadResource.kt
Created January 31, 2018 12:57
Kotlin function to load content of a packaged resource
fun loadResource(resource: String): String =
try {
object {}.javaClass.getResource(resource)
.readText(Charsets.UTF_8)
} catch (all: Exception) {
throw RuntimeException("Failed to load resource=$resource!", all)
}
@arya-oss
arya-oss / INSTALL.md
Last active November 18, 2023 13:58
Ubuntu 16.04 Developer Tools installation

Ubuntu 16.04 Developer Tools Installation

First things first !

sudo apt update
sudo apt upgrade

Standard Developer Tools

sudo apt-get install build-essential git
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@xem
xem / readme.md
Last active May 11, 2024 23:57
Maths & trigonometry cheat sheet for 2D & 3D games

Conventions

  • A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
  • lengths are in any unit (ex: pixels)
  • code snippets are in JavaScript

Degrees to radians

angleRad = angleDeg * Math.PI / 180;

@phosphoer
phosphoer / GravityItem.cs
Last active May 27, 2023 19:54
Mario Galaxy Gravity for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@codemaster
codemaster / CameraShake.cs
Created April 23, 2016 17:49
Unity Script that shakes the camera!
using UnityEngine;
//! Script that shakes the camera
public class CameraShake : MonoBehaviour
{
//! The amplitude/strength of the shake.
//! Higher values shake the camera harder.
public float shakeAmplitude = 0.7f;
//! Dampen is how fast our shake stops. Default is 1.
public float dampenFactor = 1.0f;
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@davydovanton
davydovanton / shallow_attributes_vs_virtus.rb
Last active February 7, 2019 16:45
Benchmark: shallow_attributes vs virtus
require 'benchmark/ips'
require 'shallow_attributes'
require 'virtus'
hash = {
addresses: [
{
street: 'Street 1/2',
city: {
name: 'NYC'
@subfuzion
subfuzion / curl.md
Last active July 3, 2024 11:43
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.