Skip to content

Instantly share code, notes, and snippets.

View folke's full-sized avatar
🌴
On vacation soon

Folke Lemaitre folke

🌴
On vacation soon
View GitHub Profile
@folke
folke / quake.sh
Created January 26, 2023 20:59
Hyprland Quake Mode
#!/bin/env bash
WORKSPACE=$(hyprctl clients -j | jq -rec '.[] | select(.class == "quake") | .workspace .name')
if [ -z "$WORKSPACE" ]; then
echo "start"
hyprctl dispatch -- exec wezterm --config window_background_opacity=0.9 start --class quake
elif [ "$WORKSPACE" == "special" ]; then
echo "show"
hyprctl dispatch movetoworkspace "1,^(quake)\$"
@folke
folke / lua-lsp.lua
Last active March 7, 2023 19:17
Correct sumneko lua lsp setup for init.lua and plugin development
-- put this file somewhere in your nvim config, like: ~/.config/nvim/lua/config/lua-lsp.lua
-- usage: require'lspconfig'.sumneko_lua.setup(require("config.lua-lsp"))
local library = {}
local path = vim.split(package.path, ";")
-- this is the ONLY correct way to setup your path
table.insert(path, "lua/?.lua")
table.insert(path, "lua/?/init.lua")
@folke
folke / apropos.fish
Created October 1, 2020 12:34
Using `apropos` on macos rebuilds the whatis database every time. Fish shell uses apropos for command completion.
# Fixes extremely slow apropos command on macos
# Using `apropos` on macos rebuilds the whatis database every time.
# Fish shell uses apropos for command completion.
# Simply add the file below to `~/.config/fish/conf.d` to fix the issue
set db ~/.whatis.db
function apropos_update
echo "Updating apropos / whatis database at $db"
man --path | tr ":" " " | xargs /usr/libexec/makewhatis -o $db
// eslint-disable-next-line import/no-commonjs
var assert = require('assert');
function starRegex(pattern: string) {
return RegExp(
pattern
.split('.')
.map(x => {
if (x === '**') return '[a-zA-Z\\.]*';
if (x.includes('**'))
@folke
folke / cxstudio.css
Last active November 17, 2015 16:23
.br-brand-logo {
background: url(http://my.teslamotors.com/sites/all/modules/custom/tesla_d7_menu/logo.svg) no-repeat;
background-size: 140px 60px;
}
.br-btn-secondary {
background-color: rgba(0,0,0,0);
border: none;
color: white;
padding-top: 15px;
bootstrap.mlockall: true
# Cluster Settings
cluster:
name: engagor
routing:
allocation:
node_initial_primaries_recoveries: 100
node_concurrent_recoveries: 20
cluster_concurrent_rebalance: 2
bootstrap.mlockall: true
# Cluster Settings
cluster:
name: engagor
routing:
allocation:
node_initial_primaries_recoveries: 100
node_concurrent_recoveries: 20
cluster_concurrent_rebalance: 10
(function($){
var Responsifier = {
grid: [900, 768, 660, 560, 460, 360],
update: function() {
$('html').add('.responsive').each(function(){
var $el = $(this);
var w = $el.width();
_.each(Responsifier.grid, function(v){
if (w < v)
$el.addClass("responsive-" + v);
var newBody = "YOUR NEW BODY CONTENT";
var keep = $('#olark, #habla_beta_container_do_not_rely_on_div_classes_or_names')
.add($('iframe[src*=olark]').parent());
$('body').children().not(keep).remove();
$('body').prepend(newBody);