Skip to content

Instantly share code, notes, and snippets.

@nukadelic
nukadelic / EditorFontSize.cs
Last active July 18, 2024 21:41
Unity Editor Font Size Changer -- EditorStyles
#if UNITY_EDITOR
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Reflection;
public class EditorFontSize : EditorWindow
{
// enable resize on launch to set a default font size , using this option will disable the ability to have the window accassible

robot-gltf

Summary

An effort to replace ROS packages describing a robot (a directory structure with URDF, SRDF, OBJ-MTL-STL-salad) with a single GLTF 2.0 GLB file including URDF and SRDF descriptions in the "extras" field of the GLTF header.

Proposed Robot-GLTF Format

  • All geometry is put into a GLTF 2.0 .GLB file.
  • Nodes in GLTF scene description are not used, but can be defined for visualization
  • The URDF and SRDF descriptions are stored in the extras field of the GLTF header.
  • Using the extras field keeps us completely compliant with the spec.
@lucasw
lucasw / create_cloud_xyzrgb.py
Created April 25, 2018 00:08
Create PointCloud2 with python with rgb
#!/usr/bin/env python
# PointCloud2 color cube
# https://answers.ros.org/question/289576/understanding-the-bytes-in-a-pcl2-message/
import rospy
import struct
from sensor_msgs import point_cloud2
from sensor_msgs.msg import PointCloud2, PointField
from std_msgs.msg import Header
@citrusui
citrusui / dropdown.md
Last active July 17, 2024 17:15
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
#!/usr/bin/env python
from __future__ import print_function
import rospy
from concurrent.futures import ThreadPoolExecutor
class AsyncServiceProxy(object):
"""Asynchronous ROS service proxy
@awesomebytes
awesomebytes / inertia_matrix.py
Last active December 7, 2023 13:39
Compute inertia matrix for simple solids: cube, sphere and cylinder
#/usr/bin/env python
# Based on:
# http://mathworld.wolfram.com/MomentofInertia.html
def get_cube_inertia_matrix(mass, x, y, z):
"""Given mass and dimensions of a cube return intertia matrix.
:return: ixx, ixy, ixz, ixy, iyy, iyz, ixz, iyz, izz
From https://www.wolframalpha.com/input/?i=moment+of+inertia+cube"""
@staltz
staltz / migration-guide.md
Last active December 19, 2023 22:14
How to show migration guides in GitHub Markdown

How to show migration guides in GitHub Markdown

Use the diff code highlighting tag.

  ```diff
  - foo
  + bar

Example:

@azazdeaz
azazdeaz / animachine.md
Last active October 19, 2015 15:17
Reactive 2015 Lightning Talk Proposal

Hi, i'm working on this tool called [animachine] which helps creating timeline based animations for React components.

It's packed in a [chrome extension][extension] so you don't need to open your project in an other program to animate it with a rich GUI. (You can vote by ⭐-ing this gist)

Made with React and Redux

@ohanhi
ohanhi / joy-of-composition.md
Last active May 6, 2024 05:21
The Joy of Composition - Why stateless rendering is pure bliss

This is a proposal for a lightning talk at the Reactive 2015 conference.

NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut!

The Joy of Composition

Why stateless rendering is pure bliss

React just got stateless components, meaning that they are in essence pure functions for rendering. Pure functions make it dead simple - even fun - to refactor your views

/**
* Returns the global object.
* Works even inside ES6 modules.
*/
function getGlobalObject() {
// Workers don’t have `window`, only `self`
if (typeof self !== 'undefined') {
return self;
}
if (typeof global !== 'undefined') {