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
-- in ~/.config/nvim/lua/convert-to-template-string.lua | |
local M = {} | |
local replace_surroundings_with = function(node, char) | |
local start_row, start_col, end_row, end_col = node:range() | |
vim.api.nvim_buf_set_text(0, start_row, start_col, start_row, start_col + 1, { char }) | |
vim.api.nvim_buf_set_text(0, end_row, end_col - 1, end_row, end_col, { char }) | |
end |
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 random | |
import math | |
from vpython import sphere, vector, scene | |
RANGE = 30 | |
X_START = -RANGE - RANGE / 2 | |
X_END = RANGE + RANGE / 2 | |
Y_START = -RANGE | |
Y_END = RANGE | |
RADIUS = 0.05 * RANGE |
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
" ~/.vim/after/syntax/python.vim or ~/.config/nvim/after/syntax/python.vim | |
syn match pythonEscape +{{+ contained containedin=pythonfString,pythonfDocstring | |
syn match pythonEscape +}}+ contained containedin=pythonfString,pythonfDocstring | |
syn region pythonfString matchgroup=pythonQuotes | |
\ start=+[fF]\@1<=\z(['"]\)+ end="\z1" | |
\ contains=@Spell,pythonEscape,pythonInterpolation | |
syn region pythonfDocstring matchgroup=pythonQuotes | |
\ start=+[fF]\@1<=\z('''\|"""\)+ end="\z1" keepend | |
\ contains=@Spell,pythonEscape,pythonSpaceError,pythonInterpolation,pythonDoctest |
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
local M = {} | |
function M.make() | |
local lines = {""} | |
local winnr = vim.fn.win_getid() | |
local bufnr = vim.api.nvim_win_get_buf(winnr) | |
local makeprg = vim.api.nvim_buf_get_option(bufnr, "makeprg") | |
if not makeprg then return end |
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
Sub DownloadReports | |
Dim Username As String, Password As String, SecurityToken As String | |
Username = "username" | |
Password = "password" | |
SecurityToken = "secret" | |
Dim SessionId As String | |
SessionId = SalesforceLogin(Username, Password, SecurityToken) |
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
hi cellDelimiterHi ctermbg=8 ctermfg=0 | |
sign define cellLine linehl=cellDelimiterHi | |
function! HighlightCellDelimiter() | |
execute "sign unplace * group=cellsDelimiter file=".expand("%") | |
for l:lnum in range(line("w0"), line("w$")) | |
if getline(l:lnum) =~ "^#%%$" | |
execute "sign place ".l:lnum." line=".l:lnum." name=cellLine group=cellsDelimiter file=".expand("%") | |
endif |
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
local severity_map = { "E", "W", "I", "H" } | |
local parse_diagnostics = function(diagnostics) | |
if not diagnostics then return end | |
local items = {} | |
for _, diagnostic in ipairs(diagnostics) do | |
local fname = vim.fn.bufname() | |
local position = diagnostic.range.start | |
local severity = diagnostic.severity | |
table.insert(items, { |
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
#!/bin/bash | |
n=1 | |
curl "https://ww1.demonslayermanga.com/chapter/demon-slayer-kimetsu-no-yaiba-chapter-$1/" | | |
sed -n '/<img class/p' | | |
sed -nr 's/.*src="(.*)".*/\1/p' | | |
tr -d '\015' | # some carriage return got in the way, gotta delete them | |
while read url; | |
do curl "$url" --create-dirs --output "$(printf %03d $1)/$(printf %02d $n).png"; |
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
# gerar uma sequência de -2pi até 2pi, com discretização de 2000 | |
t <- seq(from = -2*pi, to = 2*pi, length.out = 2000) | |
# função para gerar os valores de x | |
X <- function(t, a, A = 1, d = pi/2) { | |
A*sin(a*t+d) | |
} | |
# para gerar os valores de y | |
Y <- function(t, b, B = 1) { |