Skip to content

Instantly share code, notes, and snippets.

View erickgnavar's full-sized avatar
🐛
Writing bugs one at time

Erick Navarro erickgnavar

🐛
Writing bugs one at time
View GitHub Profile

Integra cualquier linter a Emacs con Flymake

Agenda

  • Conocer que es un linter y como funciona
  • Conocer flymake
  • Integrar ruff, linter de python, en emacs
system.activationScripts.applications.text = let
env = pkgs.buildEnv {
name = "system-applications";
paths = config.environment.systemPackages;
pathsToLink = "/Applications";
};
in
pkgs.lib.mkForce ''
# Set up applications.
echo "setting up /Applications..." >&2
(let* ((status-line (buffer-substring-no-properties (line-beginning-position) (line-end-position)))
(status-code (nth 1 (split-string status-line " "))))
(unless (string-equal status-code "201")
(user-error "There was a problem with GitHub API, try again later"))
(search-forward "\n\n")
(let* ((raw-response (buffer-substring-no-properties (point) (point-max)))
(data (json-parse-string raw-response))
(defun my/gist-handle-response (response)
"Process content of RESPONSE and extract link."
(interactive)
(let* ((status-line (buffer-substring-no-properties (line-beginning-position) (line-end-position)))
(status-code (nth 1 (split-string status-line " "))))
(unless (string-equal status-code "201")
(user-error "There was a problem with GitHub API, try again later"))
(search-forward "\n\n")
(puthash filename file files)
(puthash "files" files payload)
(let ((url-request-method "POST")
(url-request-extra-headers `(("Content-Type" . "application/json") ("User-Agent" . "gist.el") ("Authorization" . ,(concat "Bearer " oauth-token))))
(url-request-data (json-encode payload)))
(url-retrieve "https://api.github.com/gists" 'my/gist-handle-response))))
(defun my/gist-handle-response ()
"Process content of RESPONSE and extract link."
(interactive)
(let ((url-request-method "POST")
(url-request-extra-headers `(("Content-Type" . "application/json") ("User-Agent" . "gist.el") ("Authorization" . ,(concat "Bearer " oauth-token))))
(url-request-data (json-encode payload)))
(url-retrieve "https://api.github.com/gists" 'my/gist-handle-response))))
(defun my/gist-handle-response (response)
"Process content of RESPONSE and extract link."
(let* ((status-line (buffer-substring-no-properties (line-beginning-position) (line-end-position)))
(status-code (nth 1 (split-string status-line " "))))
(unless (not (string-equal status-code 201))
(user-error "There was a problem with GitHub API, try again later"))
(search-forward "\n\n")
(let* ((raw-response (buffer-substring-no-properties (point) (point-max)))
(data (json-parse-string raw-response))
(gist-link (gethash "html_url" data)))
(puthash "content" content file)
(puthash filename file files)
(puthash "files" files payload)
(message (json-encode payload))
(let ((url-request-method "POST")
(url-request-extra-headers `(("Content-Type" . "application/json") ("User-Agent" . "gist.el") ("Authorization" . ,(concat "Bearer " oauth-token))))
(url-request-data (json-encode payload)))
(url-retrieve "https://api.github.com/gists" 'my/gist-handle-response))))
(require 'tree-sitter)
(require 'seq)
(require 'cl-lib)
;;TODO: mapp grammar for other langauges and complete grammar for haskell
(setq modes-mapping '((haskell-mode . (exp_apply exp_infix exp_in exp_cond exp_literal))))
(defun expr-at-point ()
"Highlight expression at point."
(interactive)
function svg2png(svgContent, width, height, callback) {
// svgContent should be in base64
let svgData = svgContent;
let canvas = document.createElement("canvas");
let context = canvas.getContext("2d");
canvas.width = width;
canvas.height = height;
let image = new Image();