Skip to content

Instantly share code, notes, and snippets.

@tito
tito / refactor.py
Created March 8, 2023 16:51
Using OpenAI/ChatGPT as refactoring tool
"""
Refactoring tool using ChatGPT from Vue 2 to Vue 3
$ export OPENAPI_APIKEY=sk.........
$ python refactor.py MyView.vue
"""
import os
import re
import sys
@mujsdev
mujsdev / Button.tsx
Created December 11, 2022 06:45
Button.tsx for Storybook
import React from "react";
export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
children: React.ReactNode;
color: "black" | "white";
size?: "sm";
hasBorder?: boolean;
disabled?: boolean;
isLoading?: boolean;
}
@OliverBalfour
OliverBalfour / README.md
Last active January 29, 2025 19:44
Obsidian custom checkbox snippet

Custom checkboxes for Obsidian! It's like deathau's snippet except updated to work really well in Live Preview mode in Obsidian 1.0.

Simply edit the x inside checkboxes to >, ?, etc. to see styling like below!

Editing Live Preview Viewing
image image image

Installation:

  • Download the checkbox.css file on this page
@gingerBill
gingerBill / odin-checklist.txt
Created February 11, 2019 12:08
Odin Checklist
Programming Language Checklist
by Colin McMillen, Jason Reed, and Elly Jones.
Odin language
[x] - yes
[~] - maybe
[?] - unknown
[text] specific answer
// ==UserScript==
// @name VKDownloadMedia
// @description Скачать фото/аудио/видео-файлы с соц. сети ВКонтакте.
// @namespace https://github.com/KJ86/VKDownloadMedia
// @version 5.5
// @date 2018-04-10
// @author KJ86
// @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSIjODI4YTk5IiBkPSJtIDEwLDYgaCA0IHYgNiBoIDMgbCAtNSw2IC01LC02IGggMyB6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvc3ZnPg==
// @homepage https://greasyfork.org/ru/scripts/7385-vkdownloadmedia
// @downloadURL https://greasyfork.org/scripts/7385-vkdownloadmedia/code/VKDownloadMedia.user.js
@titpetric
titpetric / client.lua
Created March 10, 2017 10:37
LUA FFI bridge to Go shared Lib
local ffi = require("ffi")
local awesome = ffi.load("./awesome.so")
ffi.cdef([[
typedef long long GoInt64;
typedef unsigned long long GoUint64;
typedef GoInt64 GoInt;
typedef GoUint64 GoUint;
typedef double GoFloat64;
@ktzar
ktzar / index.md
Created May 30, 2016 20:18
Why Most Unit Testing is Waste

Why Most Unit Testing is Waste

By James O Coplien from http://rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste.pdf

1.1 Into Modern Times

Unit testing was a staple of the FORTRAN days, when a function was a function and was sometimes worthy of functional testing. Computers computed, and functions and procedures represented units of computation. In those days the dominant design process composed complex external functionality from smaller chunks, which in turn orchestrated yet smaller chunks, and so on down to the level of well-understood primitives. Each layer supported the layers above it. You actually stood a good chance that you could trace the functionality of the things at the bottom, called functions and procedures, to the requirements that gave rise to them out at the human interface. There was hope that a good designer could understand a given function’s business purpose. And it was possible, at least in well-structured code, to reason about the calling tree. You could mentally simulate

@ssledz
ssledz / bash-cheat-sheet
Created May 21, 2016 14:36
BASH Cheat Sheet
B A S H C H E A T S H E E T
to page output forward (only): command filename | more
to page output forward & back: command filename | less
to print a dataset: lp datasetname (-d printerid) (-o landscape)
USE OF QUOTATION MARKS
echo "$varname" = echo The value of \$varname is \"$varname\"
= echo "The value of \$varname is \"$varname\"."
$fred='Four spaces between these words.'
@Rooster212
Rooster212 / elementsFromPoint.js
Last active February 10, 2021 11:51 — forked from oslego/elementsFromPoint.js
Gets all elements below the specified point. Checks to see if browser already has method before using a manual method. Originally found https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/dTYbg4_S2b8/bEtoAnkP0swJ
// returns a list of all elements under the cursor
//
function elementsFromPoint(x,y) {
var elements = [], previousPointerEvents = [], current, i, d;
if(typeof document.elementsFromPoint === "function")
return document.elementsFromPoint(x,y);
if(typeof document.msElementsFromPoint === "function")
return document.msElementsFromPoint(x,y);