Skip to content

Instantly share code, notes, and snippets.

View drofp's full-sized avatar
💤
Probably should be sleeping

Don Robert Pornaras drofp

💤
Probably should be sleeping
  • Google LLC
  • San Jose, CA
  • 10:18 (UTC -07:00)
View GitHub Profile
@drofp
drofp / compinit.zsh
Created July 12, 2019 22:38 — forked from ctechols/compinit.zsh
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@drofp
drofp / ordered_dithering.txt
Created April 12, 2019 07:04 — forked from MehdiNS/ordered_dithering.txt
Ordered dithering explanation
(Written as a way to stop forgetting these things.
May be wrong sometimes, as it's just the result of my research here and there.
If it helps you, give me a shout!)
Ordered dithering is a technique used to reduce - deliberately! - the precision of an image.
Motivation : artistic (mainly ?), color quantization --> reduce the number of color in an image
----------------------------------------------------------------
INTRODUCTION
@drofp
drofp / manual-uninstall-paragon-ntfs.sh
Created March 11, 2019 06:29 — forked from guycalledseven/manual-uninstall-paragon-ntfs.sh
Manually remove Paragon NTFS v15 leftovers MacOS
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
@drofp
drofp / GraphPanel
Created December 8, 2018 11:45 — forked from roooodcastro/GraphPanel.java
A simple Swing component to draw a Graph over a regular JPanel. Features a grid, customizable amount of hatch marks, axis labels,checking for minimum and maximum value to label correctly the Y-axis and customizable padding and label padding. Based on "Hovercraft Full Of Eels"'s answer on StackOverflow (http://stackoverflow.com/questions/8693342/…
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.util.ArrayList;
@drofp
drofp / Github Webhook Tutorial.md
Created October 6, 2018 07:17 — forked from jagrosh/Github Webhook Tutorial.md
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@drofp
drofp / overloaded.py
Created October 6, 2018 04:35 — forked from greezybacon/overloaded.py
Python overloaded method decorator
class overloaded(object):
"""
Simple (well, simple is relative) tool to allow for overloaded methods
in Python. Overloaded methods are methods with the same name that
receive different types of arguments. Statically typed languages such as
C++ support overloaded methods at compile time; however, dynamically
typed languages such as Python cannot support such methods, because no
type hints can be specified in the function definition.
This class operates as a decorator and allows for a cascaded design of
@drofp
drofp / ros_odometry_publisher_example.py
Created August 8, 2018 04:47 — forked from atotto/ros_odometry_publisher_example.py
Publishing Odometry Information over ROS (python)
#!/usr/bin/env python
import math
from math import sin, cos, pi
import rospy
import tf
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3
@drofp
drofp / GpsUtils.cs
Created August 6, 2018 23:00 — forked from govert/GpsUtils.cs
Convert WGS-84 geodetic locations (GPS readings) to Cartesian coordinates in a local tangent plane (Geodetic to ECEF to ENU)
using System;
using System.Diagnostics;
using static System.Math;
// Some helpers for converting GPS readings from the WGS84 geodetic system to a local North-East-Up cartesian axis.
// The implementation here is according to the paper:
// "Conversion of Geodetic coordinates to the Local Tangent Plane" Version 2.01.
// "The basic reference for this paper is J.Farrell & M.Barth 'The Global Positioning System & Inertial Navigation'"
// Also helpful is Wikipedia: http://en.wikipedia.org/wiki/Geodetic_datum