Skip to content

Instantly share code, notes, and snippets.

Lucas Costi lucascosti

View GitHub Profile
@lucascosti
lucascosti / wrap-function.coffee
Last active Mar 3, 2019
Atom function & command to wrap text in something (markdown link)
View wrap-function.coffee
# 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
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 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 Feb 21, 2018
Cinnamon Window List Width change
View CinnamonWidthChange.py
#!/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 Nov 15, 2017
On my T450s, if my LG external monitor is connected, set RGB to full.
View hdmi-colour-fix.sh
# 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
You can’t perform that action at this time.