Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View lucascosti's full-sized avatar
🚀

Lucas Costi lucascosti

🚀
View GitHub Profile
@lucascosti
lucascosti / GitHub-code-font-size.js
Created April 7, 2022 07:04
Violentmonkey script for slightly bumping up the font size when editing code on GitHub on my M1 MacBook Pro.
// ==UserScript==
// @name GitHub source editing font size on my M1 MacBook Pro.
// @description For some reason the font size is a little too small _only_ when editing in the source view.
// @author Lucas Costi
// @namespace https://lucascosti.com
// @match https://github.com/*/*/edit/*
// @match https://github.com/*/*/new/*
// @match https://gist.github.com/*/*/edit
// @match https://gist.github.com/
// @grant none
@lucascosti
lucascosti / wrap-function.coffee
Last active December 21, 2020 06:57
Atom function & command to wrap text in something (markdown link)
# Put this in to your Atom's init.coffee file
# Generic function to wrap text in something (original from https://discuss.atom.io/t/wrap-selection-in-html-tag-command/22318/7)
# set multiLine to false to split selections into single line
# You can set a cursor position in `before` or `after` using `$1`
wrapSelections = (editor, before, after, multiLine = true) ->
editor.transact ->
editor.splitSelectionsIntoLines() unless multiLine
// ==UserScript==
// @name Work Gmail multi-line email list
// @description Makes sure that the new (late 2018) Gmail interface always shows the three-line previews of email lists (mainly for split-pane mode).
// The new Gmail behaviour changes this to one-line when the list pane is wide enough (but not wide enough for my liking).
// @author Lucas Costi
// @namespace https://lucascosti.com
//// The scope below only matches the second Gmail account (which is always my work one).
// @match https://mail.google.com/mail/u/1/*
// @grant none
// ==/UserScript==
@lucascosti
lucascosti / CinnamonWidthChange.py
Created February 21, 2018 03:27
Cinnamon Window List Width change
#!/usr/bin/python
import sys
import fileinput
file = "/usr/share/cinnamon/applets/window-list@cinnamon.org/applet.js"
#file = "applet.js"
searchExp = "alloc.natural_size = 150 * global.ui_scale;"
replaceExp = "//***Lucas**** Replaced: alloc.natural_size = 150 * global.ui_scale;\n alloc.natural_size = 400 * global.ui_scale;"
for line in fileinput.input(file, inplace=1):
@lucascosti
lucascosti / hdmi-colour-fix.sh
Last active November 15, 2017 09:36
On my T450s, if my LG external monitor is connected, set RGB to full.
# Colour fix for home monitor. See: https://lucascosti.com/blog/2016/08/monitor-colour-problems-over-hdmi/ and http://losca.blogspot.com.au/2013/11/workaround-for-setting-full-rgb-when.html
# see if there is the LG monitor we are expecting
if edid-decode /sys/class/drm/card0-HDMI-A-1/edid | grep 'Manufacturer: GSM Model 5ab8 Serial Number 137681'; then
xrandr --output HDMI-1 --set "Broadcast RGB" "Full" && xrandr --output DP-1 --set "Broadcast RGB" "Full"
notify-send "LG home monitor detected: I have set RGB to Full"
fi