Skip to content

Instantly share code, notes, and snippets.

@wilsonsilva
wilsonsilva / build_raylib_for_sonoma.sh
Created October 23, 2023 04:11
Build raylib 4.5 dylib for macOS Sonoma
#!/bin/bash
FIXED_MINIAUDIO_URL="
https://raw.githubusercontent.com/mackron/miniaudio/fe5f17ecf3189c680855b030467bcfa9f8d26143/miniaudio.h"
curl -L $FIXED_MINIAUDIO_URL -o src/external/miniaudio.h
mkdir -p build
cd build
cmake \
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@bettysteger
bettysteger / Editorjs.vue
Last active April 25, 2024 06:00
Vue 3 SFC for Editor.js using v-model with own custom vue component
<template>
<div class="editorjs" ref="htmlelement"></div>
</template>
<script setup>
import EditorJS from '@editorjs/editorjs';
import EmbedTool from '@editorjs/embed';
import ListTool from '@editorjs/list';
import ImageTool from '@editorjs/image';
import VideoTool from './editorjs/video.js';
import { onMounted, onUnmounted, ref, watch } from 'vue';
@hissy
hissy / gist:5113780
Created March 8, 2013 02:30
[WordPress] include author's name in query search
<?php
function custom_search_join( $join ) {
global $wpdb;
if( is_search() ) {
$join .= " INNER JOIN $wpdb->users ON "
. "$wpdb->posts.post_author = $wpdb->users.ID ";
}
return $join;
}
function custom_search_where( $where, $query ) {
@arkatsy
arkatsy / zustand-internals.jsx
Last active April 25, 2024 05:51
How zustand works internally
import { useSyncExternalStore } from "react";
// For more on the useSyncExternalStore hook, see https://react.dev/reference/react/useSyncExternalStore
// The code is almost identical to the source code of zustand, without types and some features stripped out.
// Check the links to see the references in the source code.
// The links are referencing the v5 of the library. If you plan on reading the source code yourself v5 is the best way to start.
// The current v4 version contains lot of deprecated code and extra stuff that makes it hard to reason about if you're new to this.
// https://github.com/pmndrs/zustand/blob/fe47d3e6c6671dbfb9856fda52cb5a3a855d97a6/src/vanilla.ts#L57-L94
function createStore(createState) {
@thiloho
thiloho / getting-started-with-nix.md
Created April 25, 2024 04:57
Getting started with the Nix ecosystem

A snowflake through a magnifying glass

Getting started with the Nix ecosystem

What is this article about?

When I first started to learn how to use NixOS, the Nix package manager, and how to work with the Nix language, I was overwhelmed. While it did not take me too long to (sort of) get into it, it was not the most pleasant experience. I would say that there is not really a single source of truth, like Arch Linux users have with the ArchWiki, where you can basically look up everything. Instead, the information is spread across many different sources, which can make it difficult for beginners to find out how to do what they want to do.

The "modern nix CLI", also known as "nix3 cli", is another thing that can cause confusion when you are just starting your nix journey. There are some commands that look almost exactly the same, such as nix shell compared to nix-shell or nix-build compa

@MPThLee
MPThLee / enableDiscordExperiments.js
Last active April 25, 2024 05:50
This code doesn't work anymore. I just decided to remove this code. You can check working code on comments.
/**
* !!!! This code doesn't work anymore !!!!
*
* - You can check working code on comments. I won't update this code anymore.
*
* Also, I just decided to remove this code. You can check revisions for old code.
* Since this code was made for discord client that almost 5 years ago, It seems like doesn't work anymore.
* I don't want people keep arguing in the comments, i decided to remove this code.
*
* Note: This code is now fulfilled with Javascript comments. This code won't work even if you pasted to console. doesn't do anything.
@gingerbeardman
gingerbeardman / file.io.sh
Last active April 25, 2024 05:49 — forked from devster/file.io.sh
Simple cli tool to use file.io https://www.file.io/#one Install: curl https://gist.githubusercontent.com/gingerbeardman/a7737e4c89fccab8605f8538ddaeec0d/raw/a78f5253b0fcdbd7b893f91627a29498690356ea/file.io.sh | sudo tee /usr/local/bin/file.io && sudo chmod +x /usr/local/bin/file.io
#!/bin/sh
URL="https://file.io"
DEFAULT_EXPIRE="14d" # Default to 14 days
if [ $# -eq 0 ]; then
echo "Usage: file.io FILE [DURATION]\n"
echo "Example: file.io path/to/my/file 1w\n"
exit 1
fi
@CodeMyUI
CodeMyUI / css-only-calendar-layout-css-grid.markdown
Created May 30, 2021 06:00
CSS-Only Calendar Layout [CSS Grid]
@zsoumya
zsoumya / bc4trialreset.cmd
Created July 12, 2019 21:25
Beyond Compare 4 Trial Reset
reg delete "HKCU\Software\Scooter Software\Beyond Compare 4" /v CacheID /f