Skip to content

Instantly share code, notes, and snippets.

View roachsinai's full-sized avatar
🌴
On vacation

RoachZhao roachsinai

🌴
On vacation
View GitHub Profile
import sys, io, os.path as path, functools as ft # basic packages
import urllib.request as url_req, numpy as np, cv2 # extension packages
import torch, torch.nn as nn, torchvision.ops as ops # pytorch packages
data_path = '.' if len(sys.argv) < 2 else sys.argv[1]
image_file_url = 'https://github.com/pjreddie/darknet/raw/master/data/dog.jpg'
image_filename = path.join(data_path, 'dog.jpg')
weight_file_url = 'https://pjreddie.com/media/files/yolov3.weights'
weight_filename = path.join(data_path, 'yolov3.weights')
@balderclaassen
balderclaassen / Gnome-extension-configs.txt
Last active March 22, 2024 03:10
Backup, reset, restore, configuration of a gnome extension.
How to export (backup), reset to defaults and import (restore) the configuration of a gnome extension.
// prints the whole config to a file
dconf dump /org/gnome/shell/extensions/<extension-name>/ > ~/<backupfile>
// Resets the config to defaults (might wanna check first if the dump was a succes by opening the file)
dconf reset -f /org/gnome/shell/extensions/<extension-name>/
// Loads configuration from a file into your gnome-shell
dconf load /org/gnome/shell/extensions/<extension-name>/ < ~/<backupfile>
From what I can tell a good way to determine <extension-name> is from its url at https://extensions.gnome.org
However its better to be safe and launch dconf editor , browse to /org/gnome/shell/extensions/ and check the name.
@romainl
romainl / colorscheme-override.md
Last active April 6, 2024 22:42
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Generalities first

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.
@aiguofer
aiguofer / README.md
Last active April 27, 2023 19:12
Get info about running jupyter notebooks including memory consumption, how long they've been running, etc.
@ax3l
ax3l / matplotlib.md
Last active October 11, 2019 00:07
Matplotlib: Axes vs Axis vs Figure vs ...
@codemedic
codemedic / konsole-with-palette-colours.css
Last active July 14, 2023 13:56
CSS for KDE Konsole minimal, lighter, dark tabs
QTabBar,
QTabBar::tab
{
font-family: "Noto Sans";
font-size: 11px;
height: 16px;
padding: 2px;
border: 0px;
border-bottom: 3px solid palette(dark);
background-color: palette(dark);
@galou
galou / .ycm_extra_conf.py
Last active April 4, 2022 10:18
YouCompleteMe configuration file for ROS, copy to $ROS_WORKSPACE
# -*- coding: utf-8 -*-
##########################################################################
# YouCompleteMe configuration for ROS #
# Author: Gaël Ecorchard (2015) #
# #
# The file requires the definition of the $ROS_WORKSPACE variable in #
# your shell. #
# Name this file .ycm_extra_conf.py and place it in $ROS_WORKSPACE to #
# use it. #
@Coneko
Coneko / gist:4234842
Created December 7, 2012 17:24
How to get your code to run on different cores in OSX / iOS without CHUD.
#import <pthread.h>
#import <mach/thread_act.h>
// These two functions are declared in mach/thread_policy.h, but are commented out.
// They are documented here: https://developer.apple.com/library/mac/#releasenotes/Performance/RN-AffinityAPI/_index.html
kern_return_t thread_policy_set(
thread_t thread,
thread_policy_flavor_t flavor,
thread_policy_t policy_info,
mach_msg_type_number_t count);
@jbgo
jbgo / README.markdown
Created August 3, 2011 19:38
python dependency graph generator

python dependency graph generator

Generates a dependency graph for a list of installed python packages in the form of a dot file for graphviz.

Usage

python dependency-graph.py installed_package_name ... | dot -Tpng -o dependencies.png