Skip to content

Instantly share code, notes, and snippets.

@hyperupcall
hyperupcall / settings.jsonc
Last active May 13, 2024 22:21
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@eduardoarandah
eduardoarandah / .tmux.conf
Last active June 16, 2022 01:52
Tmux configuration to work nicely with vim
# Reload tmux config
bind r source-file ~/.tmux.conf
# one of these should work:
# set -g default-terminal tmux-256color
# set -g default-terminal xterm-256color
# neovim :checkhealth suggests
set -g default-terminal screen-256color
set-option -sa terminal-overrides ',xterm-256color:RGB'
@eduardoarandah
eduardoarandah / .vimrc
Last active February 2, 2021 17:37
Mi configuración .vimrc y coc-settings.json
scriptencoding utf-8 " basic
set nocompatible " basic
filetype off " basic
filetype plugin on " Enable filetype plugins
filetype indent on " Enable loading the indent file for specific file types
syntax enable " Enable syntax highlighting
set encoding=utf-8 " Encoding (needed in youcompleteme)
set fileencoding=utf-8 " The encoding written to file.
set noerrorbells " No annoying sound on errors
set number " Line numbers on
@damiencarbery
damiencarbery / how-not-to-use-wp-filter.php
Last active September 15, 2022 21:52
Use $wp_filter global to view functions attached to actions and filters
<?php
/*
Plugin Name: wp_filter functions
Plugin URI: http://www.damiencarbery.com/2017/06/list-functions-attached-to-an-action/
Description: List functions attached to all actions and filters. DON'T DO IT!
Author: Damien Carbery
Version: 0.1
*/
add_action( 'wp_head', 'wp_filter_the_wrong_way' );
@iben12
iben12 / 1_Laravel_state-machine.md
Last active August 12, 2023 08:36
Laravel: State-machine on Eloquent Model

Implementing State Machine On Eloquent Model*

* Update (12.09.2017): I have improved the trait so that it can be used with objects other than Eloquent Models.

Some days ago I came across a task where I needed to implement managable state for an Eloquent model. This is a common task, actually there is a mathematical model called "Finite-state Machine". The concept is that the state machine (SM) "can be in exactly one of the finite number of states at any given time". Also changing from one state to another (called transition) depends on fulfilling the conditions defined by its configuration.

Practically this means you define each state that the SM can be in and the possible transitions. To define a transition you set the states on which the transition can be applied (initial conditions) and the only state in which the SM should be after the transition.

That's the theory, let's get to the work.

@amochohan
amochohan / 01_Laravel 5 Simple ACL manager_Readme.md
Last active April 22, 2024 17:19
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@freeo
freeo / OpenVim.ahk
Created September 22, 2014 11:11
OpenVim.ahk - Windows Explorer hotkey integration of gVim
; OpenVim.ahk
;
; Author: Arthur Jaron
; EMail: hifreeo@gmail.com
; Overview:
; Explorer_GetSelection(): Helper function (found in the AHK-forums)
; OpenVim(): Core function
; Hotkeys:
; Win+Enter: Open current file in gVim session "GVIM"
@XVilka
XVilka / TrueColour.md
Last active May 28, 2024 17:42
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!