Skip to content

Instantly share code, notes, and snippets.

View kennedymwavu's full-sized avatar
🍀

Mwavu kennedymwavu

🍀
View GitHub Profile
@wch
wch / app.r
Last active December 18, 2023 16:41
Shiny example app with dynamic number of plots
max_plots <- 5
ui <- fluidPage(
headerPanel("Dynamic number of plots"),
sidebarPanel(
sliderInput("n", "Number of plots", value=1, min=1, max=5)
),
@vnijs
vnijs / server.R
Last active February 5, 2023 07:14
Example of selectize drag-and-drop in Shiny 0.12.2.9000 or higher
library(shiny)
library(DT)
dat <- mtcars
shinyServer(function(input, output, session) {
output$ui_view_vars <- renderUI({
vars <- colnames(dat)
## using selectizeInput with drag_drop and DT
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active June 13, 2024 14:23
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@lightonphiri
lightonphiri / bash-install_google_fonts_on_ubuntu.md
Last active May 27, 2024 17:53
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip

@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active June 14, 2024 05:57
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@ghosh
ghosh / micromodal.css
Last active May 30, 2024 21:23
Demo modal styles for micromodal.js and corresponding expected html. If using this, set the `awaitCloseAnimation` in config to true
/**************************\
Basic Modal Styles
\**************************/
.modal {
font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;
}
.modal__overlay {
position: fixed;
@senthilthyagarajan
senthilthyagarajan / styledatatables.r
Last active June 15, 2022 13:34
Style Datatables
library(shiny)
library(DT)
table_frame <-
function() {
htmltools::withTags(table(class = 'display',
thead(
tr(
th(rowspan = 2, 'Latitude'),
th(rowspan = 2, 'Longitude'),
@cutiko
cutiko / Readme.md
Created November 22, 2019 18:24
Git delete last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

ORIGINAL did fork but search didn't helped me

@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active June 14, 2024 09:17
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@tanho63
tanho63 / position-picker-input.R
Last active November 9, 2022 08:26
pickerInput example
positions <- data.frame(pos = c("QB","RB","WR","TE"),
posdesc = c("Quarterback","Running Back","Wide Receiver","Tight End"))
shinyWidgets::pickerInput(
inputId = 'positions',
label = 'position',
choices = positions$pos,
selected = positions$pos,
multiple = TRUE,
options = list(