Skip to content

Instantly share code, notes, and snippets.

@wybiral
wybiral / noscript-tracking.go
Last active September 11, 2023 08:53
Tracking cursor position in real-time with remote monitoring (without JavaScript)
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@jayelkaake
jayelkaake / locks.sql
Last active October 23, 2018 22:32 — forked from ludyna/locks_and_blocking.sql
PSQL Useful Queries
-- See summary of table sizes (index and storage sizes) sorted by largest size to smallest size
SELECT
table_name,
pg_size_pretty(table_size) AS table_size,
pg_size_pretty(indexes_size) AS indexes_size,
pg_size_pretty(total_size) AS total_size,
ROUND(indexes_size/1024/1024) as indexes_size_mb,
ROUND(table_size/1024/1024) as table_size_mb,
ROUND(total_size/1024/1024) as total_size_mb
FROM (
@rubberduck203
rubberduck203 / keybindings.json
Created May 12, 2018 10:56
VS Code Keybindings for running tests and switching terminal sessions
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "shift+alt+t",
"command": "workbench.action.tasks.test"
},
{
"key":"alt+cmd+[ArrowDown]",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus"
@cleverdevil
cleverdevil / init.lua
Created December 14, 2017 18:05
Current hammerspoon configuration
-- -----------------
-- Setup environment
-- -----------------
-- Animation off, mofo
hs.window.animationDuration = 0
-- Get list of screens and refresh that list whenever screens are (un)plugged
local screens = hs.screen.allScreens()
local screenwatcher = hs.screen.watcher.new(function()
@yalab
yalab / bootstrap-memo.md
Last active July 20, 2022 20:29
rails5 + webpacker + bootstrap
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add bootstrap@4.0.0-beta jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
@ekaschalk
ekaschalk / esh-custom.el
Created June 24, 2017 04:39
Customizing your emacs shell.
(require 'dash)
(require 's)
(defmacro with-face (STR &rest PROPS)
"Return STR propertized with PROPS."
`(propertize ,STR 'face (list ,@PROPS)))
(defmacro esh-section (NAME ICON FORM &rest PROPS)
"Build eshell section NAME with ICON prepended to evaled FORM with PROPS."
`(setq ,NAME
@kingscott
kingscott / Emacs
Last active November 28, 2019 21:02
;;; package --- Summary
;;; Commentary:
(require 'package)
;; Required packages:
;; - neotree
;; add MELPA and MARMALADE to archives
;;; Code:
(add-to-list 'package-archives

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
# Utilize-o em 'config/locales/', com o nome de 'devise.pt-BR.yml'.
# Em 'config/application.rb', utilize => config.i18n.default_locale = :'pt-BR'
pt-BR:
devise:
confirmations:
confirmed: "Sua conta foi confirmada com sucesso."
send_instructions: "Você receberá um e-mail para confirmar sua conta em alguns minutos."
@adham90
adham90 / spacemacs-keybindings
Last active April 5, 2024 14:24
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |