Skip to content

Instantly share code, notes, and snippets.

View pelevesque's full-sized avatar
💭
looking for work

Pierre-Emmanuel Lévesque pelevesque

💭
looking for work
View GitHub Profile
@pelevesque
pelevesque / vim.md
Created May 31, 2025 09:29 — forked from hansrajdas/vim.md
VIM commands

Acronym

  • C-a ==> CTRL-a

Modes in VIM

  • Normal mode(n) When we open mode, the default mode is normal
  • Insert mode(i) When we want to insert some text, we press i, a or A etc to go in insert mode
  • Command mode(c) When we type colon(:) from normal mode, we enters command mode
  • Visual mode(v) Using v or V or C-i

Start VIM

@pelevesque
pelevesque / SVGWriterTest.js
Created January 9, 2021 04:30 — forked from carlynorama/SVGWriterTest.js
Write SVG to file in Javascript
let centerX = 15
let centerY = 15
let radius = 10
let style = "fill:rgb(200,200,255);"
const fs = require('fs')
let svg = ""
svg += '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'
svg += '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'
function setSumOfDatumDurationsPerMusicExpression(tokens) {
let areSummingDatumDurations = false
let sumOfDatumDurations
let indexOfOpenMusicExpr
let numExprFlags
let numExprDots
for (let i = deepestDepth; i >= 0; i--) {
tokens.forEach((token, j) => {
if(token.depth === i+1 && areSummingDatumDurations && token.type === 'OPEN_MUSIC_EXPR'){
sumOfDatumDurations += token.duration