Skip to content

Instantly share code, notes, and snippets.

View gederajeg's full-sized avatar
🎯
Focusing

Gede Primahadi Wijaya Rajeg gederajeg

🎯
Focusing
View GitHub Profile
@gederajeg
gederajeg / change_standard_orthography_into_original_form_Kähler1987.md
Created September 7, 2024 08:22
Replace standardised orthography for long vowels in Kähler (1987) Enggano - German Dictionary

Context

In the transcription of Kähler (1987), the transcribers directly changed original orthography into the standardised ones. For instance, the original orthography for nasalised long vowel like ȭ was changed into õõ using the Keyman keyboard.

When õõ is generated using Keyman, it contains four characters under the hood (i.e., two combinations of o + ◌̃).

Aim

In order to search and replace these multibytes characters combining letter and diacritics, we need to:

@gederajeg
gederajeg / python-in-r.md
Created July 4, 2024 06:01
Setting up Python in RStudio on Windows

How to run properly python in R with reticulate (in Windows)

  • RStudio doesn't like the Microsoft app installation of python

  • So, install python via Anaconda

  • install the reticulate package

  • Find out the executable python in the system by opening the iPython interpreter from Anaconda, then run the code below:

@gederajeg
gederajeg / subscript-number-regex.md
Created June 1, 2024 08:59
subscript-number-regex

This is a regex range for subscript number "[\U2080-\U2089]".

  • Source from here.
  • Motivation: When I am dealing with the Austronesian Comparative Dictionary CLDF data with forms containing homonym subscript.
@gederajeg
gederajeg / select-column-based-on-row-values.md
Last active January 29, 2024 23:00
Selecting column(s) whose contents match certain values

This is inspired by a post here for the use of tidyverse to retrieve column(s) whose contents match certain value.

df |> select(where(function(x) any(grepl(",", x))))

The code above retrives any column that has a comma in it.

@gederajeg
gederajeg / comment-box_r_notebook.txt
Created March 31, 2022 14:28
Comment box in R Markdown Notebook
See this StackOverflow thread for creating a comment box in .Rmd file:
https://stackoverflow.com/questions/47806200/create-a-comment-box-using-rmarkdown-html-file
@gederajeg
gederajeg / get-copy-of-older-file-git.txt
Last active December 28, 2024 10:21
Get a copy of an older version of a file from previous commit
git show <CompleteCommitHash>:path/to/oldfile.txt > path/to/newfile.txt
Source: https://stackoverflow.com/questions/59119921/use-git-to-restore-a-copy-of-some-old-files-while-keeping-their-latest-version
Source: https://stackoverflow.com/questions/71483126/copying-a-file-from-a-specific-commit-hash-from-one-repo-into-another-unrelated
Example:
git show "af0c0e7d2b163a05db2cfb0e7f7b785251a26fa0:contemporary-enggano-interlinear-text/processing-all-contemporary-texts-ELAN-FLEX-flextext-NEW-SFM.R" > contemporary-enggano-interlinear-text/processing-all-contemporary-texts-ELAN-FLEX-flextext-NEW-SFM-copy.R
@gederajeg
gederajeg / gist_to_github_repo.md
Created December 4, 2021 04:02 — forked from ishu3101/gist_to_github_repo.md
Transfer a gist to a GitHub repository

Transfer a gist to a GitHub repository

clone the gist

git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9

rename the directory

mv 6fb35afd237e42ef25f9 ConvertTo-Markdown

change the working directory to the newly renamed directory

cd ConvertTo-Markdown

Managing Gists Locally

by Danny Quah, May 2020

Through the Embed instruction or plugin, Gist snippets on GitHub can conveniently provide posts on Medium, WordPress, and elsewhere supplementary information (lines of code, images, Markdown-created tables, and so on). But while Gist snippets on GitHub can be managed directly via browser or through something like [Gisto][], a user might also wish to manipulate them offline. This last is for many of the same reasons that a user seeks to clone a git repo to their local filesystem, modify it locally, and then only subsequently push changes back up to GitHub.

Here's how to do this:

Create the gist on GitHub and then clone it to your local filesystem:

@gederajeg
gederajeg / rnotebook-font-size-and-font-family-setting.txt
Last active December 4, 2021 03:59
Define font family and font size for html output of R Notebook
Put the following CSS either in a .css file or directly in the R Notebook writing area.
<style type="text/css">
body{
font-family: Georgia;
font-size: 14pt;
}
</style>
### inspiration and source