the-way~viav14.7.0viav2.7.16viav1.45.266%66%t66%th66%the66%the-66%the-w66%the-wa66%the-way66%the-waynew?DescriptionTake?DescriptionTakeuser?DescriptionTakeuseri?DescriptionTakeuserip?DescriptionTakeuseripu?DescriptionTakeuserinput?DescriptionTakeuserinputfrom?DescriptionTakeuserinputfromtheDescription·TakeuserinputfromtheterminalLanguage·rust?Tags(spaceseparated)cliTags(spaceseparated)·clidialoguerCodesnippet(<RET>toeditinexternaleditor)·"/var/folders/m6/7pgsm7t17hq_sgtlp6wnn3_h0000gn/T/edit-1AskbzFqjscx.rs" 0L, 0C1~NORMAL<te/var/folders/m6/7pgsm7t17hq_sgtlp6wnn3_h0000gn/T/edit-1AskbzFqjscx.rsrustutf-8[unix]100%☰ 0/1 : 1INSERT<ar/folders/m6/7pgsm7t17hq_sgtlp6wnn3_h0000gn/T/edit-1AskbzFqjscx.rs[+]rustutf-8[unix]100%☰ 24/24 : 123usedialoguer::{theme, Input};22/// Takes user input from terminal, optionally has a default and optionally displays it.21pubfnuser_input(20message:&str,-- INSERT --19default:Option<&str>,18show_default:bool,17)->Result<String, Error>{16matchdefault {15Some(default)=>Ok(Input::with_theme(&theme::ColorfulTheme::default())14.with_prompt(message)13.default(default.to_owned())12.show_default(show_default)11.interact()?10.trim()9.to_owned()),8None=>Ok(7Input::<String>::with_theme(&theme::ColorfulTheme::default())6.with_prompt(message)5.interact()?4.trim()3.to_owned(),2),1}17)->Result<String, Error>{24}INSERT<ar/folders/m6/7pgsm7t17hq_sgtlp6wnn3_h0000gn/T/edit-1AskbzFqjscx.rs[+]rustutf-8[unix]100%☰ 24/24 : 2NORMAL<ar/folders/m6/7pgsm7t17hq_sgtlp6wnn3_h0000gn/T/edit-1AskbzFqjscx.rs[+]rustutf-8[unix]100%☰ 24/24 : 1::wqSnippet#28added~viav14.7.0viav2.7.16viav1.45.2took16s66%the-wayssearch--Fuzzysearchtofindasnippetandcopy,editordeleteitsync--SyncsnippetstoaGist66%the-waysearchsearch -- Fuzzy search to find a snippet and copy, edit or delete it1/0 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── >0/210/0PressEntertocopy,Shift-righttodelete,Shift-lefttoedit21/210/0.///Ifkeyexists,addvaluetoexistingvalues-joinwithasemicolon1/10///useasdb.set_merge_operator(merge_index)fnmerge_index(_key:&[u8],old_indices:Option<&[u8]>,new_index:&[u8])->Option<Vec<u8>>{letletmutret=old_indices.map_or_else(Vec::new,|old|old.to_vec());if!ret.is_empty(){ret.extend_from_slice(&[utils::SEMICOLON]);}ret.extend_from_slice(new_index);Some(ret)}21/210/0>#1. Append to an existing key in sled | rust:database:sled:#3.Takeuserinputfromexternaleditor|rust:cli:dialoguer:#4.ParsedatesfromEnglishdateexpressions|rust#4.ParsedatesfromEnglishdateexpressions|rust:date:chrono-english:#6.PlotanROCcurve|python:plotting:matplotlib:#7.Helloworld|kotlin:test:#8.Copysometexttoclipboard|rust:cli:clipboard:#9.Bumpgitandcargoversion|sh:rust:git:#10.GetbrewSHAfornewthe-wayversion|sh:brew:the-way:#11.Linkingtoaremotejupyternotebook|sh:one-line:shell:usedialoguer::Editor;1/11///Getsinputfromexternaleditor,optionallydisplaysdefaulttextineditorpubfnexternal_editor_input(default:Option<&str>,extension:&str)->Result<String,Error>{matchEditor::new().extension(extension).edit(default.unwrap_or(""))?{Some(input)=>Ok(input),None=>Err(LostTheWay::EditorError.into()),21/211/0#1.Appendtoanexistingkeyinsled|rust:database:sled:>#3. Take user input from external editor | rust:cli:dialoguer:usechrono::{Date,Utc};1/10usechrono_english::{parse_date_string,Dialect};///Makesadatefromastring,canbecolloquiallike"nextFriday"pubfnparse_date(date_string:&str)->Result<Date<Utc>,Error>{ifdate_string.to_ascii_lowercase()=="today"{Ok(Utc::now().date())}else{Ok(parse_date_string(date_string,Utc::now(),Dialect::Uk)?.date())21/212/0>#4. Parse dates from English date expressions | rust:date:chrono-english:frommatplotlibimportcm1/12cmap_colors=cm.tab20.colorsplt.figure(figsize=(20,10))labels=["l1","l2","l3"]mapping=dict(zip(labels,range(len(labels))))groups=[mapping[x]forxindata_labels]foriinrange(len(labels)):indices=np.where(np.array(groups)==i)[0]plt.scatter(data[indices,0],data[indices,1],label=labels[i],color=cmap_colors[i])plt.legend()21/213/0>#6. Plot an ROC curve | python:plotting:matplotlib:funmain(args:Array<String>){1/3println("HelloWorld!")21/214/0>#7. Hello world | kotlin:test:useclipboard::{ClipboardContext,ClipboardProvider};1/9///Setclipboardcontentstotextpubfncopy_to_clipboard(text:String)->Result<(),Error>{letmutctx:ClipboardContext=ClipboardProvider::new().map_err(|_|LostTheWay::ClipboardError)?;ctx.set_contents(text).map_err(|_|LostTheWay::ClipboardError)?;Ok(())21/215/0gittagv<version>&&gitpushoriginv<version>&&cargopublish1/121/216/0>#9. Bump git and cargo version | sh:rust:git:>c0/216/0.13/216/0#21.Terminal0codehighlight|rust:cli:syntect:b#6.PlotanROC0curve|python:plotting:matplotlib:d#9.Bumpgitand0cargoversion|sh:rust:git:#8.Copysometextto0clipboard|rust:cli:clipboard:#20.Customizefuzzysearch|rust:0cli:skim:#28.Takeuserinputfromtheterminal|rust:0cli:dialoguer:>#3. Take user input from external editor | rust:cli:dialoguer:#4.ParsedatesfromEnglishdateexpressions|rust:date:0chrono-english:#18.S0catterplotwithgroupedandlabelleddata|python:plotting:matplotlib:>cousedialoguer::{theme,Input};1/24///Takesuserinputfromterminal,optionallyhasadefaultandoptionallydisplaysit.pubfnuser_input(message:&str,default:Option<&str>,show_default:bool,)->Result<String,Error>{matchdefault{Some(default)=>Ok(Input::with_theme(&theme::ColorfulTheme::default()).with_prompt(message).default(default.to_owned()).show_default(show_default).interact()?.trim().to_owned()),None=>Ok(Input::<String>::with_theme(&theme::ColorfulTheme::default()).with_prompt(message).interact()?.trim().to_owned(),),12/216/0#21.Terminal0codehighlight|rust:cli:syntect:b#8.0Copysometexttoclipboard|rust:cli:clipboard:#17.Groupsidentifiersac0cordingtolineage|python:bioinformatics:#9.Bumpgitand0carg0oversion|sh:rust:git:p#4.ParsedatesfromEnglishdateexpressions|rust:date:0chr0ono-english:#20.0Cust0omizefuzzysearch|rust:cli:skim::>#28. Take user input from the terminal | rust:cli:dialoguer: :#3.Takeuserinputfromexternaleditor|rust:0cli:dial0oguer:o#13.Makedo0csf0orgeometricus|sh:geometricus:pip:h>cop6/215/0#8.0Copysometexttoclipboard|rust:cli:clipboard:#6.PlotanROC0curve|pyth0on:0plotting:matplotlib::#17.Groupsidentifiersac0cordingtolineage|0python:bioinformatics:#19.Fetchasequen0cefr0omUni0Prot|python:uniprot:#13.Makedocsforgeometri0cus|sh:ge0ometricus:0pip:d>#18. Scatter plot with grouped and labelled data | python:plotting:matplotlib:>copy4/213/0#8.0Copysometexttoclipboard|rust:cli:clipboard:#17.Groupsidentifiersac0cordingtolineage|0python:bioinformatics:#19.Fetchasequen0cefromUniPr0ot|0python:uniprot::>#18. Scatter plot with grouped and labelled data |python:plotting:matplotlib:importrequests1/13defget_uniprot_sequence(uniprot_id:str)->str:mapping_url=f"http://www.uniprot.org/uniprot/{uniprot_id}.fasta"response=requests.get(mapping_url).textif"html"notinresponse.strip():return''.join(response.split('\n')[1:])else:mapping_url=f"http://www.uniprot.org/uniparc/{uniprot_id}.fasta"response=requests.get(mapping_url).textif"html"notinresponse.strip():return''.join(response.split('\n')[1:])else:returnNone4/212/0>#19. Fetch a sequence from UniProt |python:uniprot::#18.S0catterplotwithgr0oupedandlabelleddata|0python:plotting:matplotlib:fromete3importNCBITaxa1/26NCBI=NCBITaxa()defsplit_lineages(species_dict):"""Makesadictionaryoflineagegroupstoasetofidentifiersbelonginginthatlineagedefget_lineage_taxids_from_species(species:str)->list:try:taxid=NCBI.get_name_translator([species])[species][0]returnNCBI.get_lineage(taxid)exceptKeyError:return[]lineages=defaultdict(set)fori,identifierinenumerate(species_dict):ifi%20==0:print(i)forgroupin(NCBI.get_taxid_translator(get_lineage_taxids_from_species(plant_species_dict[identifier])).values()):4/211/0>#17. Groups identifiers according to lineage |python:bioinformatics:4/210/0>#8.Copysome text to clipboard | rust:cli:clipboard:Snippet#8copiedtoclipboard~viav14.7.0viav2.7.16viav1.45.2took7s66%the-waysearch---from--Snippetsfrom<date>("lastfriday"workstoo!)--help-h--Printshelpinformation--languages-l--Snippetswrittenin<language>(multiplewith'lang1lang2')--pattern-p--Snippetsmatchingpattern--tags-t--Snippetswith<tag>(multiplewith'tag1tag2')--to--Snippetsbefore<date>--version-V--Printsversioninformation66%the-waysearch--from=--from--Snippetsfrom<date>("lastfriday"workstoo!)--help-h--Printshelpinformation66%the-waysearch--languages=--languages-l--Snippetswrittenin<language>(multiplewith'lang1lang2')66%the-waysearch--pattern=66%the-waysearch--pattern=edit2/20/0#15.Thissnipetneedsediting|python:the-way:print("Editsnippet")1/12/21/0>#15. This snipet needs editing | python:the-way:?DescriptionThissnipetneedseditingDescription·ThissnippetneedseditingLanguage·pythonTags(spaceseparated)·the-wayDate·2020-10-21?Codesnippet(<RET>toeditinexternaleditor)print("Editsnippet")Codesnippet(<RET>toeditinexternaleditor)·print("Don'teditsnippet")Snippet#15changed~viav14.7.0viav2.7.16viav1.45.2took14s65%65%clear65%the-way65%the-waysearch>d0/210/0.sphinx-apidoc-efo./../geometricus&&makegithub1/114/210/0>#13. Makedocs for geometricus | sh:geometricus:pip: :#4.ParsedatesfromEnglish0dateexpressions|rust:date:chrono-english:#26.Thissnippetneedstobe0deleted|sh:the-way::#18.Scatterplotwithgroupedandlabelled0data|python:plotting:matplotlib:#1.Appendtoanexistingkeyinsled|rust:0database:sled:#28.Takeuserinputfromtheterminal|rust:cli:0dialoguer:#3.Takeuserinputfromexternaleditor|rust:cli:0dialoguer:#25.Ad0danewlanguagesyntaxtothe-way|sh:the-way:w#7.Helloworl0d|kotlin:test:>deecho"Deletesnippet"1/113/210/0>#26. This snippet needs to bedeleted | sh:the-way:#4.ParsedatesfromEnglish0date0expressions|rust:date:chrono-english:#17.Groupsi0dentifiersaccordingtolineage|python:bioinformatics:#21.Terminalco0dehighlight|rust:cli:syntect:#15.Thissnippetnee0ds0editing|python:the-way:a#1.Appendtoanexistingkeyinsled|rust:0databas0e:sled:#28.Takeuserinputfromtheterminal|rust:cli:0dialogu0er::#3.Takeuserinputfromexternaleditor|rust:cli:0dialogu0er:#13.Make0docsforg0eometricus|sh:geometricus:pip:>del7/210/0>#26. This snippet needs to bedeleted | sh:the-way:#18.Scatterplotwithgroupedan0dlab0elleddata|python:plotting:matplotlib:#25.Ad0dan0ew0languagesyntaxtothe-way|sh:the-way:o#4.Parse0datesfrom0Eng0lishdateexpressions|rust:date:chrono-english:#21.Terminalco0dehigh0light|rust:cli:syntect:#1.Appendtoanexistingkeyinsled|rust:0databas0e:s0led:#17.Groupsi0dentifiersaccordingto0lineage|python:bioinformatics:>dele>#26. This snippet needs to bedeleted | sh:the-way:#1.Appendtoanexistingkeyinsled|rust:0databas0e:s0led:o#18.Scatterplotwithgroupedan0dlab0el0leddata|python:plotting:matplotlib:#4.Parse0datesfrom0Eng0lishdate0expressions|rust:date:chrono-english:#25.Ad0dan0ew0languag0esyntaxtothe-way|sh:the-way:#17.Groupsi0dentifiersaccordingto0lin0eage|python:bioinformatics:#21.Terminalco0dehighlight|rust:c0li:synt0ect:h>delet>#26. This snippet needs to bedeleted | sh:the-way:#18.Scatterplotwithgroupedan0dlab0el0ledda0ta|python:plotting:matplotlib:#25.Ad0dan0ew0languag0esyntax0tothe-way|sh:the-way:#1.Appen0dtoan0existingkeyins0led|rus0t:database:sled:rDeletesnippet#26?·yesSnippet#26deleted~viav14.7.0viav2.7.16viav1.45.2took8s66%the-wayn66%the-wayne?Description?DescriptionT?DescriptionTa?DescriptionTak?DescriptionTakeu?DescriptionTakeus?DescriptionTakeuse?DescriptionTakeuseriput?DescriptionTakeuserin?DescriptionTakeuserinp?DescriptionTakeuserinpu?DescriptionTakeuserinputf?DescriptionTakeuserinputfr?DescriptionTakeuserinputfro?DescriptionTakeuserinputfromt?DescriptionTakeuserinputfromth?DescriptionTakeuserinputfromthet?DescriptionTakeuserinputfromthete?DescriptionTakeuserinputfromtheter?DescriptionTakeuserinputfromtheterm?DescriptionTakeuserinputfromthetermi?DescriptionTakeuserinputfromthetermin?DescriptionTakeuserinputfromthetermina?DescriptionTakeuserinputfromtheterminal?Language?Languager?Languageru?Languagerus?Languagerust?Tags(spaceseparated)?Tags(spaceseparated)c?Tags(spaceseparated)cl?Tags(spaceseparated)clid?Tags(spaceseparated)clidi?Tags(spaceseparated)clidia?Tags(spaceseparated)clidial?Tags(spaceseparated)clidialo?Tags(spaceseparated)clidialog?Tags(spaceseparated)clidialogu?Tags(spaceseparated)clidialogue?Tags(spaceseparated)clidialoguer?Codesnippet(<RET>toeditinexternaleditor)"/var/folders/m6/7pgsm7t17hq_sgtlp6wnn3_h0000gn/T/edit-1AskbzFqjscx.rs"~~~~s/m6/7pgsm7t17hq_sgtlp6wnn3_h0000gn/T/edit-1AskbzFqjscx.rs" 0L, 0C1916matchdefault {97Input::<String>::with_theme(&theme::ColorfulTheme::3.to_owned(),24}INSERT<ar/folders/m6/7pgsm7t17hq_sgtlp6wnn3_h0000gn/T/edit-1AskbzFqjscx.rs[+]rustutf-8[unix]29%☰ 7/24 : 2:w"/private/var/folders/m6/7pgsm7t17hq_sgtlp6wnn3_h0000gn/T/edit-1AskbzFqjscx.rs""/private/var/folders/m6/7pgsm7t17hq_sgtlp6wnn3_h0000gn/T/edit-1AskbzFqjscx.rs" 24L, 757C written pubfnexternal_editor_input(default:Option<&str[u8]>,new_index:&[u8])->Option<Vec<u8>>{Ok(Utc::now().unwrap_or(""))?#3.Takeuserinputfromexternaleditor|rust:cli:dialoguer:mapping=dict(zip(labels,))plt.>#8.Copysometexttoclipboard|rust:cli:clipboard:>#8. Copy some text to clipboard | rust:cli:clipboard:#8.Copysometexttoclipboard|rust:cli:clipboard:pubfnexternal_editor_input(default:Option<&str>,#9.Bumpgitand0cargoversion|sh:rust:git:rust:date:chrono-english:matchdefault{=>Ok(input),.to_ownedmapping=dict(zibool,#8.0Copysometexttoclipboard|rusti:syntect:b#13.Makedocsforgeometri0cus|sh:ge0osions|rust:date:0chr0ono-english:0/215/0.#19.Fetchasequen0cefromUniPr0otolineage|0python:bioinformatics:if=["l1","l2","l3"]return#18.S0catterplot with grouped and labelled data |python:plotting:matplotlib:defget_lineage_taxids_from_species(url).textget_lineage_taxids_from#19.Fetchasequence from UniProt |python:uniprot::>#8.Copysome text to clipboard | rust:cli:clipboard:66%the-wayse66%the-waysearch--help--pattern-p--Snippetsmatchingpattern66%the-waysearch--pattern=e66%the-waysearch--pattern=ed66%the-waysearch--pattern=edi0/20/02/20/0.>#15.Thissnipetneedsediting|python:the-way:?DescriptionThissnippetneedsediting?Languagepython?Tags(spaceseparated)the-way?Date2020-10-21?Codesnippet(<RET>toeditinexternaleditor)print("ditsnippet")?Codesnippet(<RET>toeditinexternaleditor)print("Dditsnippet")?Codesnippet(<RET>toeditinexternaleditor)print("Doditsnippet")?Codesnippet(<RET>toeditinexternaleditor)print("Donditsnippet")?Codesnippet(<RET>toeditinexternaleditor)print("Don'ditsnippet")?Codesnippet(<RET>toeditinexternaleditor)print("Don'tditsnippet")?Codesnippet(<RET>toeditinexternaleditor)print("Don'tditsnippet")?Codesnippet(<RET>toeditinexternaleditor)print("Don'teditsnippet")65%c65%cl65%cle65%clea65%t65%th65%the65%the-65%the-w65%the-wa65%the-ways65%the-wayse>#13. Make to an existing key in sled | rust:database:sled:#1.Appendtoanexistingkeyinsled|rust>#26. This snippet needs to bedesh:geometricus:pip: :#1.Appendtoanexistingkeyterminal|rust:cli:0dialoguer:#13.Make0docsforg0eometricus|sh:geometri#25.Ad0dani0dentifiersaccordingtolineage|python:bioinformatics:#17.Groupsi0dentifiefromtheterminal|rust:cli:0dialogu0er::#18.Scatterplotwithgroupedan0dthe-way|sh:the-way:o#17.Groupsi0dentifiersaccordingto0lin0eage|python:s0led:#18.Scatterplotwithgroupedan0dlab0el0leddata|python:plotting:matplotlib:#4.Parse0datesfrom0Eng0lishxtothe-way|sh:the-way:#4.Parse0datesfrom0Eng0lishdate0expressions|rus0t:date:chrono-english:#17.Groupsi0dentifiersaccordingto0lineag0e|py0thon:bioinformatics:#21.Terminalco0dehighlight|rust:c0li:synt0ec0t:h?Deletesnippet#26?(y/n)no