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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " 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 |
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.
- 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:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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) |
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:
- http://stackoverflow.com/questions/17547473/how-to-open-a-new-tab-using-selenium-webdriver
- http://stackoverflow.com/questions/6421988/webdriver-open-new-tab/9122450#9122450
- https://groups.google.com/forum/#!topic/selenium-users/kah4iEPRopc
- ... and many many more.
So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |