Skip to content

Instantly share code, notes, and snippets.

@dgrapov
dgrapov / Orthogonal Signal Correction (OSC) for PLS models OSC-PLS (OPLS)
Last active November 28, 2023 03:28
Orthogonal Signal Correction for PLS models (OPLS)
#see updated code base and some examples in the function "test"
# https://github.com/dgrapov/devium/blob/master/R/Devium%20PLS%20%20and%20OPLS.r
#Orthogonal Signal Correction for PLS models (OPLS)
#adapted from an example in the book <a href="http://www.springer.com/life+sciences/systems+biology+an+bioinfomatics/book/978-3-642-17840-5">"Chemometrics with R by Ron Wehrens"</a>
#this code requires the following packages:
need.packages<-c("pls", # to generate PLS models
"ggplot2" ) # to plot results
@stevenyap
stevenyap / Github Flavored Markdown.md
Last active March 28, 2024 17:42
Github Flavored Markdown cheatsheet

Github Flavored Markdown (GFMD) is based on Markdown Syntax Guide with some overwriting as described at Github Flavored Markdown

Text Writing

It is easy to write in GFMD. Just write simply like text and use the below simple "tagging" to mark the text and you are good to go!

To specify a paragraph, leave 2 spaces at the end of the line

Headings

@caseywatts
caseywatts / bookmarkleting.md
Last active June 8, 2024 20:32
Making Bookmarklets

This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Making Bookmarklets

I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!

A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:.

@jalapic
jalapic / viridisschiz
Created October 3, 2015 01:27
Australian Schizophrenia Births
### Example Viridis Plot
library(ggplot2)
library(viridis)
library(season)
library(gridExtra)
pa<-ggplot(schz, aes(year, month, fill = SczBroad)) +
geom_tile(colour="gray20", size=1.5, stat="identity") +
scale_fill_viridis(option="A") +

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@idleberg
idleberg / atom-macos-context-menu.md
Last active April 27, 2022 00:37
“Open in Atom” in macOS context-menu

Open in Atom

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /usr/local/bin/atom -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Atom
@mbinna
mbinna / effective_modern_cmake.md
Last active June 19, 2024 02:23
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@aleksandrs-ledovskis
aleksandrs-ledovskis / README.md
Last active November 11, 2023 01:06
Lock Spotify version (macOS)
  1. Create new Automator application with Run Shell script action (exact steps below).

    1. Open Automator.app (e.g. from Spotlight)
    2. Select File → New in menu
    3. Select "Application", click "Choose"
    4. With "Actions" toggle selected, type "Run Shell Script" in filter box, double click on filtered item
  2. Put contents from lock_spotify_version.sh into script's body (exact steps below).

  3. In opened right-hand item select /bin/sh as "Shell" type and copy contents of Gist's "lock_spotify_version.sh" below/in text area