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
@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 June 6, 2024 13:15
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 20, 2023 07:12
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 April 19, 2024 09:17 — 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 April 14, 2022 09:43
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()
@aarroyoc
aarroyoc / apt-ftparchive.conf
Last active March 5, 2024 10:45
Debian/Ubuntu repo using apt-ftparchive
Dir {
ArchiveDir "./debian";
CacheDir "./cache";
};
Default {
Packages::Compress ". gzip bzip2";
Sources::Compress ". gzip bzip2";
Contents::Compress ". gzip bzip2";
};
TreeDefault {