Skip to content

Instantly share code, notes, and snippets.

View y56's full-sized avatar
🌏
(* ̄▽ ̄)/‧☆*"`'*-.,_,.-*'`"*-.,_☆

Eugene y56

🌏
(* ̄▽ ̄)/‧☆*"`'*-.,_,.-*'`"*-.,_☆
View GitHub Profile
@y56
y56 / How to install Japanese Input in Linux (tutorial)
Created April 9, 2020 20:52
How to install Japanese Input in Linux (tutorial)
https://www.reddit.com/r/linux/comments/byugan/how_to_install_japanese_input_in_linux_tutorial/
==
How to install Japanese Input in Linux (tutorial)
Introduction:
Hello, my name is Eitan. I am new to linux but i am learning rapidly.
I want to contribute to the community by writing a tutorials for things that might sound easy and unnecessary but for some it might help a lot. if you see that i wrote something wrong please be sure that your write in the comments so i will fix myself.
(This tutorial was tested on debian based oses)
@y56
y56 / ERROR launchpadlib 1.10.6 requires testresources which is not installed
Created April 11, 2020 19:26
ERROR: launchpadlib 1.10.6 requires testresources, which is not installed.
https://www.discoverbits.in/864/error-launchpadlib-requires-testresources-which-installed
==
ERROR: launchpadlib 1.10.6 requires testresources, which is not installed.
+2 votes
asked Oct 6, 2019 in Programming Languages by pythonuser (11.5k points)
recategorized Oct 6, 2019 by pythonuser
I am getting the following error when I try to upgrade setuptools:
@y56
y56 / collections.defaultdict
Last active April 19, 2020 01:29
collections.defaultdict(int) collections.defaultdict(lambda: 0)
collections.defaultdict(int)
# good
collections.defaultdict(lambda: 0)
# good
collections.defaultdict(lambda x:x**2)
# TypeError: <lambda>() missing 1 required positional argument: 'x'
# it seems program expects function without arguments
@y56
y56 / spyder4 on conda anaconda miniconda along with apt spyder3
Created April 30, 2020 05:21
spyder4 on conda anaconda miniconda along with apt spyder3
apt has its spyder3 (3.2.6)
let's install miniconda
download here https://docs.conda.io/en/latest/miniconda.html
run
$ sh Miniconda3-latest-Linux-x86_64.sh
use miniconda to install spyder4
$ conda install spyder
so I can have them both
@y56
y56 / How to hide hover tooltips on Spyder 4
Created April 30, 2020 05:40
How to hide hover tooltips on Spyder 4
https://stackoverflow.com/questions/59225879/how-to-hide-hover-tooltips-on-spyder-4
not sure where to ask:
is there a way to not have the help tooltip/popup/hover window opening in spyder?
since updating to 4.0 the window does not close when you change between windows:
https://stackoverflow.com/questions/59225879/how-to-hide-hover-tooltips-on-spyder-4
@y56
y56 / How do I prevent Conda from activating the base environment by default
Created April 30, 2020 05:41
How do I prevent Conda from activating the base environment by default?
https://stackoverflow.com/questions/54429210/how-do-i-prevent-conda-from-activating-the-base-environment-by-default
==
I recently installed anaconda2 on my Mac. By default Conda is configured to activate the base environment when I open a fresh terminal session.
I want access to the Conda commands (i.e. I want the path to Conda added to my $PATH which Conda does when initialised so that's fine).
But I don't ordinarily program in python, and I don't want Conda to activate an environment by default.
@y56
y56 / functools.lru_cache
Created April 30, 2020 06:04
functools.lru_cache
import functools
@functools.lru_cache(None)
def f(x):
print('f')
return 2
def g(x):
print('g')
return 2
@y56
y56 / keyboard shortcut for mouse right click menu by keyboard
Created June 4, 2020 19:09
keyboard shortcut for mouse right click menu by keyboard
https://superuser.com/questions/195167/keyboard-shortcut-for-mouse-right-click
There isn't one for left-click, though spacebar and Enter are often usable.
Right-clicking is usually a request for a context-sensitive menu which is performed on the keyboard either by typing
≣ Menu key (https://en.wikipedia.org/wiki/Menu_key),
Shift+F10,
@y56
y56 / Key mapping for apple mac magic wireless keyboard on Windows 10
Created July 11, 2020 16:19
Key mapping for apple mac magic wireless keyboard on Windows 10
https://github.com/uxsoft/AppleWirelessKeyboard/releases/
@y56
y56 / git stash apply
Created July 14, 2020 09:56
Git - opening and editing files from other branches
https://stackoverflow.com/questions/38016277/git-opening-and-editing-files-from-other-branches
There two ways you can do this:
Commit the changes in alt branch and then do git checkout master.
If you do not want to commit then do git stash in alt branch and then go to master by doing this: git checkout master. Later once you have done the testing in master, checkout to alt and do git stash apply(this would reapply the changes to alt branch).
Each time you do git stash it creates a list of changes, which can be checked by git stash list. Each item will have an index number to it starting from 0. So if you stash more than once you can reapply a particular stash like this: git stash apply @stash{<index_no>}.