Skip to content

Instantly share code, notes, and snippets.

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

Eugene y56

🌏
(* ̄▽ ̄)/‧☆*"`'*-.,_,.-*'`"*-.,_☆
View GitHub Profile
@y56
y56 / xdg-open filename
Created January 18, 2020 04:33
xdg-open filename
It can also be done by using xdg-open filename.
Command will open the file with it's default application and it also used to open the urls .
@y56
y56 / spyder color schem monokai yorked
Created January 6, 2020 00:25
spyder color schem monokai yorked
https://imgur.com/UN2Cjwj
https://imgur.com/a/UzOz3u5
<blockquote class="imgur-embed-pub" lang="en" data-id="a/UzOz3u5" data-context="false" ><a href="//imgur.com/a/UzOz3u5"></a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>
@y56
y56 / how-to-set-up-jupyter-notebook-with-python-3-on-ubuntu-18-04
Created January 4, 2020 11:25
how-to-set-up-jupyter-notebook-with-python-3-on-ubuntu-18-04
https://www.digitalocean.com/community/tutorials/how-to-set-up-jupyter-notebook-with-python-3-on-ubuntu-18-04
@y56
y56 / vpn on ubuntu vpngate openvpn
Created January 2, 2020 22:12
vpn on ubuntu vpngate openvpn
https://www.vpnusers.com/viewtopic.php?t=2861
====
You can connect all VPN Gate server by following settings.
HostName: Please get from this page http://www.vpngate.net/en/
UserName: vpn
Password: vpn
Pre-shared key: vpn
@y56
y56 / global-keyword-in-python
Last active January 2, 2020 02:52
global-keyword-in-python
https://www.geeksforgeeks.org/global-keyword-in-python/
To access a global variable inside a function there is no need to use global keyword.
If we need to assign a new value to a global variable then we can do that by declaring the variable as global.
This output is an error because we are trying to assign a value to a variable in an outer scope. This can be done with the use of global variable.
@y56
y56 / to adjust wine font size
Created December 27, 2019 02:40
to adjust wine font size
# wine regedit
Search for "LogPixels" there. You will see something like this:
"LogPixels"=dword:00000060
Change 60 to something more suitable. For example this is what I use with my
two displays (one with resolution 1680x1050 and another one with 1280x1024):
"LogPixels"=dword:00000095
@y56
y56 / firefox-color.y
Created December 17, 2019 03:27
firefox-color
https://color.firefox.com/?theme=XQAAAAIVAQAAAAAAAABBqYhm849SCia2CaaEGccwS-xNKlhW9r_vLXIlVnuJdAic7eRjUc7NRneKMRgQIDK-eQWrkV64LlDNDxf_eMByAZRY7cQeDk2YcCQuge8iz6wsuNPluyBJiPNe5xIoZzicTFzQ6DMdJYDEw-AeRyNROrGJ4T-DeBLGg-1Vj7VZ3d9k5NxuR_XDp27McA_KR92FIt5YLJrt4-wN1xy00G2UBvBL10ttWMmb3Fj4oR16M_W9K9p__-NlUeA
@y56
y56 / pip3 install numpy
Created December 4, 2019 01:47
pip3 install numpy
python 要用 pip install numpy
python3 要用 pip3 install numpy
想一想也是很合理
@y56
y56 / autopep8
Created November 26, 2019 01:52
autopep8
The program autopep8 can be used to automatically reformat code in the PEP 8 style. Install the program with:
$ pip install autopep8
Use it to format a file in-place with:
$ autopep8 --in-place optparse.py
Excluding the --in-place flag will cause the program to output the modified code directly to the console for review. The --aggressive flag will perform more substantial changes and can be applied multiple times for greater effect.
@y56
y56 / pycodestyle
Created November 26, 2019 01:51
pycodestyle
That being said, conforming your Python code to PEP 8 is generally a good idea and helps make code more consistent when working on projects with other developers. There is a command-line program, pycodestyle (previously known as pep8), that can check your code for conformance. Install it by running the following command in your terminal:
$ pip install pycodestyle
Then run it on a file or series of files to get a report of any violations.
$ pycodestyle optparse.py
optparse.py:69:11: E401 multiple imports on one line
optparse.py:77:1: E302 expected 2 blank lines, found 1
optparse.py:88:5: E301 expected 1 blank line, found 0