Skip to content

Instantly share code, notes, and snippets.

View ksvbka's full-sized avatar
💭
CFF - Code for food 👍

Trung Kien ksvbka

💭
CFF - Code for food 👍
View GitHub Profile
@facontidavide
facontidavide / point_converter.hpp
Last active June 19, 2024 01:18
Convert any point 3D from one type to another.
#include <type_traits>
// Magically converts any representation of a point in 3D
// (type with x, y and z) to another one. Works with:
//
// - pcl::PointXYZ, pcl::PointXYZI, pcl::PointXYZRGB, etc
// - Eigen::Vector3d, Eigen::Vector3f
// - custom type with x,y,z fields.
// - arrays or vectors with 3 elements.
@andrewssobral
andrewssobral / agx_xavier_tips-and-tricks.md
Last active April 12, 2024 18:21
Tips and Tricks for Jetson AGX Xavier
@b01
b01 / download-vs-code-server.sh
Last active September 5, 2024 21:23
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/bin/sh
# Copyright 2023 Khalifah K. Shabazz
#
# 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:
@alex-spataru
alex-spataru / A QML Material Drawer.md
Last active August 8, 2024 02:04
Implementation of a simple and clean Material drawer for your QtQuick/QML applications

Description

This gist allows you to implement a material drawer easily for your projects. It consists of three files:

  • PageDrawer.qml The drawer itself, with an icon viewer, a list view and some hacks to execute the actions/functions assigned to each drawer item
  • DrawerItem.qml Which can act as an action, a spacer, a separator or a link
  • SvgImage.qml Ugly hack to make SVG images look crisp and smooth on HDPI screens

Licence

This code is released under the WTFPL, for more information click here.

@0x4D31
0x4D31 / beautiful_idiomatic_python.md
Last active September 5, 2024 12:30 — forked from JeffPaine/beautiful_idiomatic_python.md
[Beautiful Idiomatic Python] Transforming Code into Beautiful, Idiomatic Python #python

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@ruebenramirez
ruebenramirez / setup-franz-ubuntu.sh
Created September 7, 2016 17:55
setup franz on ubuntu
#!/bin/bash
sudo rm -fr /opt/franz
sudo rm -fr /usr/share/applications/franz.desktop
# create installation dir
sudo mkdir -p /opt/franz
#install franz
@RogerGee
RogerGee / dpkgdeps
Last active March 23, 2018 13:39
Debian Package Dependency Reducer (python2)
#!/usr/bin/env python
import re
import sys
import subprocess
# This program reduces dependency lists down to their top-level
# dependencies. It works by building a dependency tree obtained by
# repeated invocations of 'apt-cache depends'. It was developed for
# finding dependency list for Debian package (.deb files) control
# files.
@patik
patik / how-to-squash-commits-in-git.md
Last active May 30, 2024 07:59
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@ksvbka
ksvbka / i2c_hw.c
Last active September 8, 2024 14:12
I2C Hardware for MSP430
/********************************************************************************
Product: I2C - Hardware - Block
Module: I2C
Created: 12/04/2015, by KIENLTB
Description: I2C Driver for MSP430
********************************************************************************/
/*-----------------------------------------------------------------------------*/
@candidtim
candidtim / myappindicator_v1.py
Last active September 8, 2020 14:58
Minimal set-up for an Ubuntu AppIndicator in Python
from gi.repository import Gtk as gtk
from gi.repository import AppIndicator3 as appindicator
APPINDICATOR_ID = 'myappindicator'
def main():
indicator = appindicator.Indicator.new(APPINDICATOR_ID, 'whatever', appindicator.IndicatorCategory.SYSTEM_SERVICES)
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
indicator.set_menu(gtk.Menu())
gtk.main()