Skip to content

Instantly share code, notes, and snippets.

Avatar
🏄‍♂️
Surfing

Folke Lemaitre folke

🏄‍♂️
Surfing
View GitHub Profile
@folke
folke / lua-lsp.lua
Last active Aug 28, 2021
Correct sumneko lua lsp setup for init.lua and plugin development
View lua-lsp.lua
-- 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 Oct 1, 2020
Using `apropos` on macos rebuilds the whatis database every time. Fish shell uses apropos for command completion.
View apropos.fish
# 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
View starmatch.ts
// 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('**'))
View cxstudio.css
.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;
View gist:5351982
bootstrap.mlockall: true
# Cluster Settings
cluster:
name: engagor
routing:
allocation:
node_initial_primaries_recoveries: 100
node_concurrent_recoveries: 20
cluster_concurrent_rebalance: 2
View gist:5348941
bootstrap.mlockall: true
# Cluster Settings
cluster:
name: engagor
routing:
allocation:
node_initial_primaries_recoveries: 100
node_concurrent_recoveries: 20
cluster_concurrent_rebalance: 10
View responsifier.js
(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);
View olark body replace.js
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);
@folke
folke / dabblet.css
Created Dec 17, 2011
The first commented line is your dabblet’s title
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;