Skip to content

Instantly share code, notes, and snippets.

View thomasantony's full-sized avatar

Thomas Antony thomasantony

View GitHub Profile
/*************
* colors.js *
*************
*
* You're almost at the exit. You just need to get past this
* color lock.
*
* Changing your environment is no longer enough. You must
* learn to change yourself. I've sent you a little something
* that should help with that.
@uraimo
uraimo / dnsovertls.md
Last active April 26, 2025 05:23
Configure your Mac to use DNS over TLS
@styblope
styblope / docker-api-port.md
Last active May 3, 2025 07:44
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
import numpy as np
def vectorize(x):
# vectorize a string
if len(x) > 1:
return np.sum([vectorize(c) for c in x], axis=0)
if x == '.':
i = 27
elif x == ' ':
i = 26
@niclasmattsson
niclasmattsson / .Monotonic cubic splines with draggable Plotly points
Last active October 22, 2024 11:09
Monotonic cubic splines with draggable Plotly points
Nothing here, just a Gist hack to display the title correctly on Gist.
(Prefix the title of this file with a dot on Gist.)
@csarron
csarron / installTensorFlow1.2Py3OnJetsonTX2.sh
Last active August 9, 2017 08:52
Install TensorFlow 1.2 Python 3 On Jetson TX 2
#!/bin/bash
#install dependencies
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer -y
sudo apt-get install zip unzip autoconf automake libtool curl zlib1g-dev maven -y
sudo apt install python3-numpy python3-dev python3-pip python3-wheel
# install bazel
@bpinaya
bpinaya / CarDetection.py
Created February 22, 2017 23:49
Detectnet on a video video input. Call: python CarDetection.py yourSnap.caffemodel deplot.prototxt input.mp4 output.mp4
# Based on
# https://gist.github.com/lukeyeager/777087991419d98700054cade2f755e6
#--------------------------------------------------------------------
# CarDetection runs Detectnet on a video pipeline (TX1 Tested)
# This might be run only once if no ffmpeg is installed
#import imageio
#imageio.plugins.ffmpeg.download()
import cv2
@lukeyeager
lukeyeager / example.py
Last active September 21, 2017 19:38
DetectNet Python Inference
#!/usr/bin/env python2
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
"""
Classify an image using individual model files
Use this script as an example to build your own tool
"""
import argparse
@Garrett-R
Garrett-R / gzip_str.py
Last active March 12, 2022 10:17
Demo of how to gzip and gunzip a string in Python 3
"""How to gzip a string.
This works for Python 3.2. For 3.1-, look at the original gist (under "Revisions")
"""
import gzip
def gzip_str(string_: str) -> bytes:
return gzip.compress(string_.encode())
@jmtatsch
jmtatsch / gist:44e7c1a55fc29432254bdc61559d91c7
Last active April 12, 2018 05:10
ROS Kinetic on Sierra Work in Progress
# NOTE: These instructions do not represent a robust, self-troubleshooting install; they
# are definitely not suitable for dumping to a giant script and running as one. If you
# use them, they should be run one at a time, with an eye out for errors or problems
# along the way.
#
# The #1 issue you are likely to encounter is with Homebrew or Python packages whose
# binary components link against system Python. This will result in runtime segfaults,
# especially in rviz. If you suspect this is occurring, you can attempt to remove and
# reinstall the offending packages, or go for the nuclear option--- empty your Cellar
# and site-packages folders and start over with brewed python from the beginning.