Skip to content

Instantly share code, notes, and snippets.

View iTrauco's full-sized avatar

Christopher Trauco iTrauco

View GitHub Profile

Start new Change

In VIM a new change usually only starts when you leave insert mode (i.e. if you press u for undo, everything in the last insert is reverted). By pressing ctrl+g and then u, you can start a new change while in insert mode. You could even map the return key to do this automatically when you start a new line: :inoremap u (undo will now only undo single lines).

Easy Split Navigation

Use :sp to split the current window in two (:vs for vertical split).

Add the following mapping commands to your .vimrc for easier split navigation.

"easy split navigation
nnoremap <C-J> <C-W><C-J>
nnoremap  
@iTrauco
iTrauco / .vimrc
Created August 2, 2020 16:52 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@iTrauco
iTrauco / README.md
Created December 1, 2020 09:05 — forked from m1keil/README.md
Configure Kibana to use SAML with GSuite (Google Apps, GApps, G Suite)

The following worked with Elastic Cloud, Elasticsearch & Kibana v7.6.0. It should be pretty close for other kinds of deployments. Before starting, make sure you have the right license level that allows SAML.

Create SAML App in GSuite:

  • Navigate to the SAML apps section of the admin console
  • Click the Add button and choose to "SETUP MY OWN CUSTOM APP"
  • Write down the Entity ID and download the Idp metadata file
  • Choose application name, description and add logo
  • In the "Service Provider Details" screen add the following:
@iTrauco
iTrauco / refreshUrl.py
Created December 17, 2020 01:45 — forked from sposterkil/refreshUrl.py
A little python script to refresh a given URL every 10 seconds
#! /usr/bin/env python3
import webbrowser
from time import sleep
url = input('Input the URL to reload, including "http://: ')
while True:
print("refreshing...")
webbrowser.open(url, new=0)
@iTrauco
iTrauco / refreshUrl.py
Created December 17, 2020 01:45 — forked from sposterkil/refreshUrl.py
A little python script to refresh a given URL every 10 seconds
#! /usr/bin/env python3
import webbrowser
from time import sleep
url = input('Input the URL to reload, including "http://: ')
while True:
print("refreshing...")
webbrowser.open(url, new=0)
@iTrauco
iTrauco / python-selenium-open-tab.md
Created December 17, 2020 01:49 — forked from lrhache/python-selenium-open-tab.md
Python Selenium - Open new tab / focus tab / close tab

On a recent project, I ran into an issue with Python Selenium webdriver. There's no easy way to open a new tab, grab whatever you need and return to original window opener.

Here's a couple people who ran into the same complication:

So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.

@iTrauco
iTrauco / Code.gs
Created January 30, 2021 13:12 — forked from primaryobjects/Code.gs
Export a Google Drive spreadsheet to PDF in Google Drive in the same folder.
// Simple function to add a menu option to the spreadsheet "Export", for saving a PDF of the spreadsheet directly to Google Drive.
// The exported file will be named: SheetName and saved in the same folder as the spreadsheet.
// To change the filename, just set pdfName inside generatePdf() to something else.
// Running this, sends the currently open sheet, as a PDF attachment
function onOpen() {
var submenu = [{name:"Save PDF", functionName:"generatePdf"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu('Export', submenu);
}
@iTrauco
iTrauco / Code.gs
Created January 30, 2021 13:12 — forked from primaryobjects/Code.gs
Export a Google Drive spreadsheet to PDF in Google Drive in the same folder.
// Simple function to add a menu option to the spreadsheet "Export", for saving a PDF of the spreadsheet directly to Google Drive.
// The exported file will be named: SheetName and saved in the same folder as the spreadsheet.
// To change the filename, just set pdfName inside generatePdf() to something else.
// Running this, sends the currently open sheet, as a PDF attachment
function onOpen() {
var submenu = [{name:"Save PDF", functionName:"generatePdf"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu('Export', submenu);
}
@iTrauco
iTrauco / separator.py
Created February 25, 2021 18:01 — forked from jlln/separator.py
Efficiently split Pandas Dataframe cells containing lists into multiple rows, duplicating the other column's values.
def splitDataFrameList(df,target_column,separator):
''' df = dataframe to split,
target_column = the column containing the values to split
separator = the symbol used to perform the split
returns: a dataframe with each entry for the target column separated, with each element moved into a new row.
The values in the other columns are duplicated across the newly divided rows.
'''
def splitListToRows(row,row_accumulator,target_column,separator):
split_row = row[target_column].split(separator)