Skip to content

Instantly share code, notes, and snippets.

You can get detailed performance per function call with this snippet. Edit the lark main and add the setup to the beginning and the result printing to the bottom. Optimally, lark could have a command line option which activates this on its main.

import sys

import io
import pstats
import cProfile

profiller = cProfile.Profile()

Replacing backticks `word` with **`word`**

  1. Create a buffer only with `git`
  2. Press Ctrl+H to open Find and Replace
  3. Set Find to (?<!\*)`([^\n*`]+?)`(?!\*)
  4. Set Replace to **`\1`**
  1. Find to ((?:[^*]))`([^\n*`]+?)`(?!\*)
  2. Replace to \1**`\2`**

Heroku Docker Tutorial (for dummies)

Using single application per git repository

  1. Create a Dockerfile on the root of your project. For example, this Dockerfile-myaplication:
    FROM evandrocoan/ubuntu18nodejspython:latest
```python
@classmethod
def is_applicable(cls, settings):
try:
view = inspect.currentframe().f_back.f_locals['view']
```
https://github.com/SublimeText/LaTeXTools/blob/5bbec63a11e44feb1ff550a16c486fef68a3eaac/st_preview/preview_math.py#L531
@evandrocoan
evandrocoan / mmap_python_usage.md
Last active July 25, 2023 08:47
Example of shared memory usage in python using mmap!
import mmap
import time
import sys
import json

# https://docs.python.org/3.9/library/mmap.html
# https://blog.askesis.pl/post/2019/02/mmap.html
memory = mmap.mmap( -1, 20, access=mmap.ACCESS_WRITE )
```sh
#!/bin/bash
val1=`vmstat -f 1 | cut -d 'f' -f1 | tr -d " \t\n\r"`
while true
do
val2=`vmstat -f 1 | cut -d 'f' -f1 | tr -d " \t\n\r"`
result=$(($val2 - $val1))
echo $result new forks
import sublime
import sublime_plugin

class MaxPaneEvents(sublime_plugin.EventListener):

    def on_selection_modified(self, view):
        print( 'I am on_selection_modified...', view.id() )