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:22 (UTC -07:00)
View GitHub Profile
@drofp
drofp / tmux_iterm_scrollback.md
Created March 30, 2021 16:49
Tmux iterm integration tips and best practices

Change scrollback limit for tmux buffer on iterm

Original stackoverflow post here

Solution

  • iTerm2 build 1.0.0.20130302 has an preference which enables it to capture scrollback even when a so-called hard status line is present:
  • maybe also check "Save lines to scrollback in alternate screen mode"

So, whats wrong with the following start to a constructor of a Graph class?

public Graph(String fileName) {
    File file = null;
    try {
        file = new File(fileName);
    } catch (Exception e) {
        // TODO: handle exception
 }
@gaearon
gaearon / modern_js.md
Last active September 20, 2024 11:11
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@sbarratt
sbarratt / geo.py
Last active January 26, 2024 12:55
This script provides coordinate transformations between geodetic, ecef and enu in python. Based on https://gist.github.com/govert/1b373696c9a27ff4c72a.
"""
This script provides coordinate transformations from Geodetic -> ECEF, ECEF -> ENU
and Geodetic -> ENU (the composition of the two previous functions). Running the script
by itself runs tests.
based on https://gist.github.com/govert/1b373696c9a27ff4c72a.
"""
import math
a = 6378137
b = 6356752.3142
@guycalledseven
guycalledseven / manual-uninstall-paragon-ntfs.sh
Last active September 10, 2024 04:39
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/
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active September 25, 2024 10:49
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
@atotto
atotto / ros_odometry_publisher_example.py
Last active August 21, 2024 06:45
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
@tasdikrahman
tasdikrahman / python_tests_dir_structure.md
Last active September 15, 2024 16:13
Typical Directory structure for python tests

A Typical directory structure for running tests using unittest

Ref : stackoverflow

The best solution in my opinion is to use the unittest [command line interface][1] which will add the directory to the sys.path so you don't have to (done in the TestLoader class).

For example for a directory structure like this:

new_project

├── antigravity.py

@ctechols
ctechols / compinit.zsh
Last active September 19, 2024 15:38
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