This file contains 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
from LSP.plugin.core.handlers import LanguageHandler | |
from LSP.plugin.core.settings import ClientConfig | |
class LspRcppPlugin(LanguageHandler): | |
name = "cquery-r" | |
def __init__(self): | |
self._config = ClientConfig( | |
name=self.name, |
This file contains 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
## All functions from other packages will be called | |
## using the double colon (::) (i.e. the scope operator) | |
# 1. | |
library(RcppAlgos) | |
library(arrangements) | |
library(microbenchmark) | |
options(digits = 4) |
This file contains 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
import cProfile, pstats | |
pr = cProfile.Profile() | |
pr.enable() | |
pr.disable() | |
ps = pstats.Stats(pr).sort_stats('time') | |
ps.print_stats(10) |
This file contains 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
import rapi | |
rapi.start() | |
# let R to set the locale | |
import ctypes | |
from ctypes import wintypes | |
MultiByteToWideChar = ctypes.windll.kernel32.MultiByteToWideChar | |
MultiByteToWideChar.argtypes = [wintypes.UINT, wintypes.DWORD, | |
wintypes.LPCSTR, ctypes.c_int, |
This file contains 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
from LSP.plugin.core.handlers import LanguageHandler | |
from LSP.plugin.core.settings import ClientConfig | |
from LSP.plugin.core.rpc import Notification | |
import os | |
class LspClangRcppPlugin(LanguageHandler): | |
name = "clangd-rcpp" |
This file contains 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
#include <windows.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
#define BUFSIZE 1024 | |
int main(int ac, char** av) { | |
HANDLE h = GetStdHandle(STD_INPUT_HANDLE); | |
DWORD rd; |
This file contains 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
// [[Rcpp::depends(cubature)]] | |
// [[Rcpp::depends(RcppArmadillo)]] | |
#include <RcppArmadillo.h> | |
#include <exp_cubature.h> | |
using namespace Rcpp; | |
const double log2pi = std::log(2.0 * M_PI); | |
arma::vec mu; |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>homebrew.mxcl.syncthing</string> | |
<key>EnvironmentVariables</key> | |
<dict> | |
<key>HOME</key> | |
<string>/Users/Randy</string> |
This file contains 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
# https://gist.github.com/fikr4n/368f2f2070e0f9a15fb4 | |
from math import sqrt | |
def _square(x): | |
return x * x | |
def rgb(x): |
This file contains 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
# -*- coding: UTF-8 -*- | |
# From https://github.com/gnunn1/tilix/blob/3f0a3d37f10f6ecfce30deca41636bb13020c2b3/data/nautilus/open-tilix.py | |
# Example modified for Pantheon Terminal | |
# Shortcuts Provider was inspired by captain nemo extension | |
from gettext import gettext, textdomain | |
from subprocess import PIPE, call | |
from urllib import unquote | |
from urlparse import urlparse |