Skip to content

Instantly share code, notes, and snippets.

@hute37
hute37 / install-alacritty-ubuntu.sh
Created October 2, 2020 10:18 — forked from Aaronmacaron/install-alacritty-ubuntu.sh
Install Alacritty on Ubuntu
#!/bin/bash
# This installs alacritty terminal on ubuntu (https://github.com/jwilm/alacritty)
# You have to have rust/cargo installed for this to work
# Install required tools
sudo apt-get install -y cmake libfreetype6-dev libfontconfig1-dev xclip
# Download, compile and install Alacritty
git clone https://github.com/jwilm/alacritty
@hute37
hute37 / vim-shortcuts.md
Created August 28, 2020 12:16 — forked from tuxfight3r/vim-shortcuts.md
VIM SHORTCUTS

VIM KEYBOARD SHORTCUTS

MOVEMENT

h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
@hute37
hute37 / xrandr.sh
Created August 24, 2020 20:33 — forked from chirag64/xrandr.sh
#!/bin/bash
#If no argument is specified, ask for it and exit
if [[ -z "$@" ]];
then
echo "An argument is needed to run this script";
exit
else
arg="$@"
#Basic check to make sure argument number is valid. If not, display error and exit
if [[ $(($(echo $arg | grep -o "\s" | wc --chars) / 2 )) -ne 2 ]];
@hute37
hute37 / PortSwitch.php
Created July 21, 2020 22:02 — forked from bueltge/PortSwitch.php
Port switch to get an workaround to use WordPress Multisite also without the default port 80.
<?php # -*- coding: utf-8 -*-
declare( strict_types = 1 );
/**
* Plugin Name: Port Switch
* Plugin URI: https://gist.github.com/bueltge/51013ab809f5f0f5e305c70c2d393fff
* Description: Port switch to get an workaround to use WordPress Multisite also without the default port 80.
* Version: dev
* Author: Frank Bültge
* Author URI: https://bueltge.de
* License: MIT
#different aggregate functions
table = pd.pivot_table(df,index=['Sex','Pclass'],aggfunc={'Age':np.mean,'Survived':np.sum})
table
df.groupby(['Outlet_Type','Item_Type']).agg(mean_MRP=('Item_MRP',np.mean),mean_Sales=('Item_Outlet_Sales',np.mean))
df['Item_Weight'] = df.groupby(['Item_Fat_Content','Item_Type'])['Item_Weight'].transform(lambda x: x.fillna(x.mean()))
def filter_func(x):
return x['Item_Weight'].std() < 3
df_filter = df.groupby(['Item_Weight']).filter(filter_func)
df_filter.shape
#displays the subtotal using margins and margins_name
# margins is a boolean field that should be made True if total values need to be printed.
# margins_name is the optional field where you can name the margin row/column in your grouped table.
table = pd.pivot_table(df,index=['Sex'],columns=['Pclass'],values=['Survived'],aggfunc=np.sum, margins=True, margins_name='Total_Survived')
table
@hute37
hute37 / simple_fab
Created January 31, 2020 08:27 — forked from aananya27/simple_fab
import time
def fibonacci_sequence_of(num):
first_number = 0
second_number = 1
num = int(num)
if num == 0:
print ("Fibonacci of {} is {}".format(num,num))
elif num ==1:
print ("Fibonacci of {} is {}".format(num,num))
else: