Skip to content

Instantly share code, notes, and snippets.

View xaviervalarino's full-sized avatar

Xavier Valarino xaviervalarino

View GitHub Profile
@20015jjw
20015jjw / gist:08db8dbb801c29706e76
Last active May 10, 2016 18:01
Add these lines to .bash_profile to allow iterm2 to switch profiles with the time in the day.
# Define a function that switches iterm profile
iterm2_profile() { echo -e "\033]50;SetProfile=$1\a"; }
# Change profile by $HOUR
# You'll need to change name of profiles to Light and Dark
HOUR=`date +"%H"`
if [ $HOUR -gt 6 ] && [ $HOUR -lt 18 ];
then iterm2_profile Light;
else iterm2_profile Dark;
fi
#!/bin/bash
kwmc=$HOME/bin/kwmc
currentFocus=$($kwmc query focus-follows-mouse)
currentMouse=$($kwmc query mouse-follows-focus)
tag=$($kwmc query space active mode)
if [ "$1" = 'quit' ]; then
killall kwm
@noxify
noxify / Page.php
Created December 18, 2018 12:14
Twill pages - custom edit template
//app/Models/Page.php
<?php
namespace App\Models;
use A17\Twill\Models\Behaviors\HasBlocks;
use A17\Twill\Models\Behaviors\HasSlug;
use A17\Twill\Models\Behaviors\HasMedias;
use A17\Twill\Models\Behaviors\HasRevisions;
@xavierlacot
xavierlacot / gist:5051742
Created February 27, 2013 21:10
LibreOffice odp odt ods Quicklook preview on OSX
$ cd /System/Library/QuickLook
$ sudo wget http://trinity.neooffice.org/downloads/neopeek.qlgenerator.tgz | tar xzvf
@slowkow
slowkow / index.html
Last active December 1, 2021 23:47
Karabiner-Elements mouse4 to back and mouse5 to forward
<html>
<body>
<a href="karabiner://karabiner/assets/complex_modifications/import?url=https%3A%2F%2Fgist.githubusercontent.com%2Fslowkow%2F275e53573e2aeb60c8304add1e54faf5%2Fraw%2Fc63540925dba76f46293834c24700ebf1578ed10%2Fmouse-buttons-back-forward.json">click here to import into Karabiner-Elements</a>
</body>
</html>
@nyergler
nyergler / init.lua
Created May 21, 2018 15:57
My Hammerspoon window management configuration
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "W", function()
hs.alert.show(
"Hello World!",
{
textFont= "Comic Sans MS",
textSize=72,
fadeOutDuration=1
}
)
end)
" deoplete.vim contains vim settings relevant to the deoplete autocompletion
" plugin
" for more details about my neovim setup see:
" http://afnan.io/2018-04-12/my-neovim-development-setup/
" deoplete options
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1
" disable autocomplete by default
@micimize
micimize / window_stacks.lua
Created July 7, 2021 02:49
hammerspoon script for stacking and rotating through windows
hs.window.animationDuration = 0 -- disable animations
local menuHeight = 40
local W = hs.window
local WF = hs.window.filter
local G = hs.geometry
function getWindowsBehind(region)
local wf = WF.copy(WF.defaultCurrentSpace):setRegions({region})
@spamwax
spamwax / bubbles.lua
Created July 26, 2021 22:57
galaxyline theme
--[[
-- To get the icons working correctly:
-- 1. Install nonicons.ttf from https://github.com/yamatsum/nonicons
-- 2. Install nvim plugin https://github.com/yamatsum/nvim-nonicons
--]]
local gl = require("galaxyline")
local gls = gl.section
local fileinfo = require('galaxyline.provider_fileinfo')
local iconz = require("nvim-nonicons")
@smjonas
smjonas / inc_rename.lua
Last active March 1, 2023 14:45
Incremental LSP rename command based on Neovim's command-preview feature
-- Usage: type :IncrementalRename <new_name> while your cursor is placed above an identifier (LSP must be enabled)
-- Update: this gist will no longer be updated since this command has been turned into a plugin!
-- You can find the plugin here: https://github.com/smjonas/inc-rename.nvim
local state = {
added_lines = false,
orig_lines = {},
lsp_positions = {},
}