Skip to content

Instantly share code, notes, and snippets.

Lucas Costi lucascosti

Block or report user

Report or block lucascosti

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
lucascosti /
Last active Mar 3, 2019
Atom function & command to wrap text in something (markdown link)
# Put this in to your Atom's file
# Generic function to wrap text in something (original from
# 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
View Gmail-List-userscript.js
// ==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
//// The scope below only matches the second Gmail account (which is always my work one).
// @match*
// @grant none
// ==/UserScript==
lucascosti /
Created Feb 21, 2018
Cinnamon Window List Width change
import sys
import fileinput
file = "/usr/share/cinnamon/applets/"
#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 /
Last active Nov 15, 2017
On my T450s, if my LG external monitor is connected, set RGB to full.
# Colour fix for home monitor. See: and
# 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"
You can’t perform that action at this time.