Skip to content

Instantly share code, notes, and snippets.

View keyle's full-sized avatar
👾

keyle

👾
View GitHub Profile
@hyperupcall
hyperupcall / settings.jsonc
Last active July 21, 2024 10:53
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!!
{
@almonk
almonk / Notify.swift
Last active March 27, 2023 07:55
A little wrapper for NSNotifications with Swift
//
// Notify.swift
//
import Foundation
class Notify {
static let shared = Notify()
func send(event: NSNotification.Name) {
@cjwcommuny
cjwcommuny / MacEditorTextView.swift
Created October 31, 2021 10:46
An NSTextView wrapped by SwiftUI with TextKit 2
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2021
* https://twitter.com/tholanda
*
* MIT license
* Modified by https://github.com/cjwcommuny for TextKit 2
*/
import Combine
.toolbar {
ToolbarItemGroup {
Button(action: {}, label: {
Image(systemName: "sidebar.left")
})
Spacer()
Button(action: {}, label: {
Image(systemName: "play.fill")
})
Button(action: {}, label: {
@uheartbeast
uheartbeast / ChromaticAberration.shader
Created August 27, 2019 14:42
Simple Chromatic Aberration Shader for Godot 3
shader_type canvas_item;
uniform bool apply = true;
uniform float amount = 1.0;
uniform sampler2D offset_texture : hint_white;
void fragment() {
vec4 texture_color = texture(TEXTURE, UV);
vec4 color = texture_color;
@maoueh
maoueh / main.go
Last active June 20, 2024 23:47
golang gorilla mux sub/router + specific middleware per subrouter
package main
import (
"time"
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func main() {
@NicholasBellucci
NicholasBellucci / ScrollingTextView.swift
Last active March 1, 2024 03:37
MacOS swift marquee scrolling text view
import Cocoa
open class ScrollingTextView: NSView {
// MARK: - Open variables
/// Text to scroll
open var text: NSString?
/// Font for scrolling text
open var font: NSFont?
@giodamelio
giodamelio / outline-bookmarklet.js
Last active April 4, 2022 13:01
A bookmarklet to process the current page to Outline.com and redirect afterwards.
fetch(
"https://outlineapi.com/v3/parse_article?source_url=" +
encodeURIComponent(window.location)
)
.then(res => res.json())
.then(body => {
if (body.error) {
return alert(`Outline Bookmarklet Error: ${body.error}`);
}
window.location.href = `https://outline.com/${body.data.short_code}`
@Adrodoc
Adrodoc / tetris.lua
Last active October 19, 2021 07:39
tetris.lua
require 'mickkay.wol.Spell'
tetris = {}
tetris.delay = 10
tetris.origin = Vec3(453985, 80, -888253)
tetris.width = 10
tetris.height = 20
tetris.rotationCenter = Vec3(0,-1,0)
local upperCenter = tetris.origin + Vec3(tetris.width//2 + 1, tetris.height-1, 0)
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.