Skip to content

Instantly share code, notes, and snippets.

View barrosfelipe's full-sized avatar
🎴
Feeding forms

Felipe Barros barrosfelipe

🎴
Feeding forms
  • Berlin
View GitHub Profile
(defun copy-buffer-file-name ()
"Puts the file name of the current buffer (or the current directory,
if the buffer isn't visiting a file) onto the kill ring, so that
it can be retrieved with \\[yank], or by another program."
(interactive)
(let ((fn (or
(buffer-file-name (current-buffer))
;; Perhaps the buffer isn't visiting a file at all. In
;; that case, let's return the directory.
(expand-file-name default-directory))))
@martinhansdk
martinhansdk / README
Last active February 23, 2018 22:33
Check keypass database against pwned passwords.
Download the list of password hashes from https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/ unpack it and check it against your keepass file with this script.
requires python3, libkeypass from https://github.com/libkeepass/libkeepass and
```
apt-get install python3-crypto python3-lxml
```
@levibostian
levibostian / post.md
Last active April 15, 2020 20:31
webpack, Tachyons, pug, Vue.js web app.

Today, single page web apps are driving many websites that we use each and every day. Instead of having your browser request a new web page for each and every action you perform on a web page, single page web apps may load all in one request to smoothly and quickly transition with every action you perform.

When building single page web apps, you may decide to retrieve all of the HTML, CSS and Javascript with one single page load or dynamically load these resources as the user moves about your site. Either way, it can be a pain to bundle all of these assets together for the end user to download from your web server. This is where webpack comes into play.

webpack does all of the heavy lifting bundling all of your HTML, CSS and Javascript together. If you write your site all from scratch or depend on dependencies from npm, webpack takes care of packaging it all together for you. It has the ability to take your single page web app, cut out all of the code you don't need, then packa

@practicalli-johnny
practicalli-johnny / .spacemacs.el
Last active May 9, 2020 09:19
My Spacemacs configuration for Clojure development & Org-mode kanban
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@plaidfinch
plaidfinch / pretty-pragmata.el
Last active July 15, 2021 01:56
Mappings for prettify-symbols-mode to enable Pragmata Pro's ligatures in Emacs. I've taken some slight liberties with the original ligature map, to suit my own tastes.
;; PRETTIFY SYMBOLS (with Pragmata Pro)
(defun setup-pragmata-ligatures ()
(setq prettify-symbols-alist
(append prettify-symbols-alist
'(("!!" . ?)
("!=" . ?)
("!==" . ?)
("!≡" . ?)
("!≡≡" . ?)
("!>" . ?)
@pesterhazy
pesterhazy / promises-passing-values.cljs
Last active October 24, 2021 00:55
Promise chains in ClojureScript and the problem of previous values
(ns my.promises
"Demo to show different approaches to handling promise chains in ClojureScript
In particular, this file investigates how to pass data between Promise
callbacks in a chain.
See Axel Rauschmayer's post
http://2ality.com/2017/08/promise-callback-data-flow.html for a problem
statement.
@alysbrooks
alysbrooks / hiccup.fnl
Created October 27, 2021 22:35
Very simple hiccup implementation
(fn gen-attributes [attributes]
(clj.reduce (fn [x y] (.. x y))
(icollect [attr val (pairs attributes)]
(string.format " %s=\"%s\"" attr val))))
;
(fn render [form]
(if (clj.string? form) (EscapeHtml form)
(clj.vector? form) (let [tag (. form 1)
attributes (when (clj.map? (. form 2) ) (. form 2))
@egh
egh / weaving.org
Created February 19, 2014 18:24
Weaving a budget with org-mode & ledger

Weaving a budget with org-mode & ledger

ledger comes with a built in budget system, but I wanted to get an “envelope”, or “YNAB” style budget working. While this was easy to do in theory, in practice it proved more difficult. The theory is pretty simple; enevelope budgeting merely requires you to create some new accounts to keep track of each “envelope” of money. But in practice, it requires a huge amount of duplicate data-entry, because even when using ledger’s automatic transactions, because each month’s budget is mostly the same but not necessarily exactly the same.The following

@agzam
agzam / all ex commands.org
Last active September 14, 2022 14:36
All ex commands
e[dit]evil-edit
w[rite]evil-write
wa[ll]evil-write-all
sav[eas]evil-save
r[ead]evil-read
b[uffer]evil-buffer
bn[ext]evil-next-buffer
bp[revious]evil-prev-buffer
bN[ext]bprevious
sb[uffer]evil-split-buffer