Skip to content

Instantly share code, notes, and snippets.

View vic's full-sized avatar
🐊
hoy amanecí dichosamente herido de muerte natural

Victor Borja vic

🐊
hoy amanecí dichosamente herido de muerte natural
View GitHub Profile

Principled Meta Programming for Scala

This note outlines a principled way to meta-programming in Scala. It tries to combine the best ideas from LMS and Scala macros in a minimalistic design.

  • LMS: Types matter. Inputs, outputs and transformations should all be statically typed.

  • Macros: Quotations are ultimately more easy to deal with than implicit-based type-lifting

  • LMS: Some of the most interesting and powerful applications of meta-programming

@tcg
tcg / how-i-configure-my-logitech-g502-mouse-to-make-me-more-productive.md
Created August 29, 2017 03:09
How I configure my Logitech G502 mouse to make me more productive

How I configure my Logitech G502 mouse to make me more productive

I use a "gaming mouse" as my current favorite every-day computer mouse, when I'm not just using the trackpad.

If you're not familiar with it, it's a great computer mouse that has some extra buttons that can be arbitrarily assigned key combos, macros, and various functions.

Recently, I decided to tweak some settings for every day desktop/work use, and I've been quite pleased. Here's a couple things I did:

Middle scroll wheel: left/right tilt

@davidwalter0
davidwalter0 / stash-pop-recover
Created August 10, 2017 17:42
Undoing accidental git stash pop
# https://stackoverflow.com/questions/6543519/undoing-accidental-git-stash-pop
# https://stackoverflow.com/questions/89332/how-to-recover-a-dropped-stash-in-git
accepted
If you have only just popped it and the terminal is still open, you will still have the hash value printed by git stash pop on screen (thanks, Dolda).
Otherwise, you can find it using this for Linux and Unix:
git fsck --no-reflog | awk '/dangling commit/ {print $3}'
and for Windows:
@surhudm
surhudm / GNUPG_agent_forwarding.md
Last active January 23, 2025 20:00
GNUPG agent forwarding

Forward GNUPG agent with the following steps:

On the remote insecure machine:

Run gpg once to create the directory structure.

gpg --list-keys

On the local machine:

@akorobov
akorobov / emacs-25.2-term-24bit-colors.diff
Last active March 20, 2018 10:16
Patch for emacs 25.2 (rc2) to enable 24-bit colors in terminal
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index f7a47f8..e9cfe7a 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -1491,6 +1491,39 @@ exhibits all the colors Emacs knows about on the current display.
Syntax highlighting is on by default since version 22.1.
+Emacs 26.1 and later support direct color mode in terminals. If Emacs
+finds Terminfo capabilities @samp{setb24} and @samp{setf24}, 24-bit
OPTIONAL MATCH path = (x)<-[*..3]-() WHERE ID(x) = 65
WITH apoc.coll.toSet([n in nodes(path) WHERE n is not null
| { id: id(n),label: labels(n),type:"",metadata: properties(n) } ]) as nodes,
apoc.coll.toSet([r in relationships(path) WHERE r is not null
| { id: id(r),source: id(startNode(r)),relation: type(r),target: id(endNode(r)), directed: "true" } ]) as rels
RETURN { graph: { type:"",label: "",directed: "true",nodes: nodes,edges: rels,
metadata:{ countNodes: size(nodes),countEdges: size(rels) } } } as graph;
@LottieVixen
LottieVixen / README.md
Last active September 15, 2025 05:36
xrandr enable and disable second screen as vnc display

Use a second laptop or headed computer as another monitor via vnc

Firstly check that xrandr has the modeline you need (resolution of the screen you want to use)

$ xrandr
Screen 0: minimum 320 x 200, current 2732 x 768, maximum 16384 x 16384
eDP connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 309mm x 173mm
   1366x768      60.00*+
 1280x720 59.86 
@redrabbit
redrabbit / absinthe_ecto_resolution_schema.ex
Last active December 1, 2023 14:29
Absinthe.Ecto.Resolution.Schema
defmodule Absinthe.Ecto.Resolution.Schema do
@moduledoc """
This module provides helper functions to resolve a GraphQL query into `Ecto.Query`.
"""
import Absinthe.Resolution.Helpers
import Ecto.Query
alias Absinthe.Resolution
alias Absinthe.Blueprint.Document.Field
anonymous
anonymous / gist:634b938ac2702db4991a98c4ce6c5ccc
Created November 21, 2016 07:04
solo un par de palabras, indecibles.
¿cómo he de hacerte sentir?
¿cómo hacerte entenderlo?
Sin que se adueñen de ti
con su rostro de espanto
la parálisis el miedo.
Las palabras que fermentan
lo que digo lo que siento
incapaz de retenerlas