start new:
tmux
start new with session name:
tmux new -s myname
import requests | |
from io import open as iopen | |
from urlparse import urlsplit | |
def requests_image(file_url): | |
suffix_list = ['jpg', 'gif', 'png', 'tif', 'svg',] | |
file_name = urlsplit(file_url)[2].split('/')[-1] | |
file_suffix = file_name.split('.')[1] | |
i = requests.get(file_url) | |
if file_suffix in suffix_list and i.status_code == requests.codes.ok: |
; how to write scripts: http://www.autohotkey.com/docs/ | |
#IfWinActive ahk_class CabinetWClass ; File Explorer | |
^Backspace:: | |
#IfWinActive ahk_class Notepad | |
^Backspace:: | |
Send ^+{Left}{Backspace} | |
#IfWinActive | |
; source and context: http://superuser.com/a/636973/124606 |
#!/usr/bin/env bash | |
# | |
# This is sp, the command-line Spotify controller. It talks to a running | |
# instance of the Spotify Linux client over dbus, providing an interface not | |
# unlike mpc. | |
# | |
# Put differently, it allows you to control Spotify without leaving the comfort | |
# of your command line, and without a custom client or Premium subscription. | |
# |
; how to write scripts: http://www.autohotkey.com/docs/ | |
#IfWinActive ahk_class CabinetWClass ; File Explorer | |
^Backspace:: | |
#IfWinActive ahk_class Progman ; Desktop | |
^Backspace:: | |
#IfWinActive ahk_class Notepad | |
^Backspace:: | |
Send ^+{Left}{Backspace} | |
#IfWinActive |
WordGrinder is a port of a Unix program, and a few things don’t map well onto the way Windows works. There are some things you need to know.
from discord.ext import commands | |
description = '''An example bot to showcase the discord.ext.commands extension | |
module. | |
There are a number of utility commands being showcased here.''' | |
# this specifies what extensions to load when the bot starts up | |
startup_extensions = ["members", "rng"] |
In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
Debian Jessie does not come with the correct Python version out of the box, and instead comes with Python 2. To be able to install Python 3(.5), we have a few options. We could build and install from source, but as per Debian's website, we shouldn't do this. Instead, we will use pyenv, a tool that allows users to switch Python versions easily without breaking their system.
To install pyenv, we will use the official installer.
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
<html> | |
<body bgcolor=000000> | |
<table boder=0 cellpadding=0 cellspacing=0> | |
<tr height=3> | |
<td width=3 bgcolor=888888 rowspan=105></td> | |
<td bgcolor=888888 colspan=54></td> | |
<td width=3 bgcolor=888888 rowspan=105></td> | |
</tr> |