Skip to content

Instantly share code, notes, and snippets.

View murych's full-sized avatar
👑
I may be slow to respond.

Timur murych

👑
I may be slow to respond.
View GitHub Profile
@murych
murych / useful_pandas_snippets.py
Created February 4, 2016 21:52 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
@murych
murych / selenium-screenshotting.md
Created March 30, 2016 11:45 — forked from dannguyen/selenium-screenshotting.md
Using Selenium and Python to screenshot a javascript-heavy page

Using Selenium and Python to screenshot a javascript-heavy page

As websites become more JavaScript heavy, it's harder to automate things like screenshotting for archival purposes. I've seen examples and suggestions to use PhantomJS for visual testing/archiving of websites, but have run into issues such as the non-rendering of webfonts. I've never tried out Selenium until today...and while I'm not thinking about performance implications yet, Selenium seems far more accurate than PhantomJS...which makes sense since it actually opens a real browser. And it's not too hard to script to do complex interactions: here's an [example of how to log in to Twitter, write a tweet, upload an image, and send a tweet via Selenium and DOM element selection](https://gist.github.com/dannguyen/8a6fa49253c1d6a0eb92

@murych
murych / Text menu.pas
Last active April 22, 2016 16:42
Pascal snippets
function MainMenu: integer;
var
menu: integer;
begin
writeln('1 - пункт 1');
writeln('2 - пункт 2');
writeln('3 - пункт 3');
writeln('0 - Выход');
readln(menu);
MainMenu := menu;
@murych
murych / openpgp.txt
Created June 20, 2016 17:50
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:6c82f45d6a3a06e635320c3a9516ca0717b509f8]
@murych
murych / battarey.sh
Last active July 9, 2016 07:30
Scripts for i3bar
#!/bin/bash
batinf='acpi -b'
perc=$(acpi -b | awk '{print $4;}' | sed 's/%//g' | sed 's/,//g')
charging=$(acpi -b | grep -c Discharging)
if [ ! $charging -eq 1 ]
then echo " $perc%"
elif (( $perc > '75' ))
then echo " $perc%"
elif (( $perc > '50' ))
then echo " $perc%"
@murych
murych / desktop_enviroment.md
Last active July 10, 2016 14:10
Setting up CrunchBang on ThinkPad X201

First, make sure i3lock, imagemagick and scrot are installed. Open a terminal :

cd /bin
sudo nano lock.sh

put this script there :

!/bin/bash
@murych
murych / jupyter_notebook.css
Created July 10, 2016 11:28
Enable Fira Code font (w/ ligatures) in Jupyter Notebook
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url("https://192.168.10.29:8888/") {
@font-face {
font-family: FiraCode;
font-style: normal;
font-weight: normal;
src: url("https://cdn.rawgit.com/tonsky/FiraCode/master/FiraCode-Regular.otf") format("opentype");
}
.CodeMirror pre {
@murych
murych / gitlab-tex-ci-2.md
Last active April 1, 2020 13:18
Using GitLab CI for Building LaTeX

@joernhees With the new Features (CI, Pages) you can do a Workaround. I did this with my Latex Repo: .gitlab-ci.yml:

variables:
  USE_BIBTEX: 'false'
  TEX_FILES: 'yourfile' # examples: 'File1 File2' OR '*.tex'
  DESTINATIONFOLDER: "processed_pdfs"
@murych
murych / centos.md
Last active January 8, 2017 01:39
centOS & fedora configuration

включение epel репозитория

  1. yum install epel-release

установка de (на всякий случай)

  1. # yum --enablerepo=epel -y groups install "Xfce" - скачивание и установка пакетов
  2. echo "exec /usr/bin/xfce4-session" >> ~/.xinitrc - запись информации о de
  3. startx - ручной запуск
  1. # yum -y install ntfs-3g
import pyscreenshot as ImageGrab
from pykeyboard import PyKeyboard
from time import sleep
from tqdm import trange
def waiting():
for _ in trange(5, desc='wait'):
sleep(1)