Skip to content

Instantly share code, notes, and snippets.

@Adirelle
Adirelle / mise.toml
Created March 15, 2024 20:10
mise + chezmoi sample configuration
[tools]
bat = "latest"
exa = "latest"
ripgrep = "latest"
zoxide = "latest"
usage = "latest"
starship = "latest"
jq = "latest"
@Adirelle
Adirelle / !MasqueTest\!MasqueTest.toc
Last active September 28, 2018 19:16
Masque: issue with addon loading order and custom skins
## Interface: 80000
## OptionalDeps: Masque
MasqueTest.lua
@Adirelle
Adirelle / Maybe.hs
Last active June 16, 2018 11:08
Pure Monad
import Data.Map.Strict
-- Monadic
f :: Map String Int -> String -> Maybe Int
f m x = do
y <- lookup m x
let y' = g y
y'' <- if y' > 8
then Just $ y' * 10
else Nothing
@Adirelle
Adirelle / post-commit
Last active April 28, 2017 04:33
Post-commit hook to testing local PHPCI
#!/bin/bash
#
# Copy this script to .git/hooks/post-commit.
# Make it executable.
# Setup a project with "remote repository" (not local !) that points your PHPCI root.
# And finally, edit the two first lines according to your local installation.
PHPCI_URL=http://my.phpci.url
PROJECT_ID="PHPCI projet identifier"
@Adirelle
Adirelle / AssetReference.php
Created July 17, 2014 12:37
Collection-recursive AssetReference for Assetic
<?php
// Implements \IteratorAggregate and AssetCollectionInterface instead of only AssetInterface
class AssetReference implements \IteratorAggregate, AssetCollectionInterface
{
/* [snip, snip] */
public function add(AssetInterface $asset)
{
$asset = $this->am->get($this->name);
--[[ Element: Monk Stagger Bar
Handles updating and visibility of the monk's stagger bar.
Widget
Stagger - A StatusBar
Sub-Widgets
@Adirelle
Adirelle / robot.js
Created December 5, 2012 13:19
AdiBot
var Robot = function(robot) {
};
var areEnemies = function(robot, other) {
return other.id != robot.parentId && other.parentId != robot.id;
}
var normalizeAngle = function(a) {
return ((a % 360) + 360) % 360;
local RV = LibStub:NewLibrary("libRaidVoice-1.0", 1)
if not RV then return end -- No upgrade needed
-----------------------------------------------------------------------------------------------------
-- use RV.RegisterCallback(self, "eventName"[, method, [arg]])
-- to register recieve voice events
-- example:
-- local RV = LibStub:GetLibrary("libRaidVoice-1.0")
local p = {}
-- p = {}
updateRecord(p, "A", 1, 2, 3, 4)
-- p = { "A", 1, 2, 3, 4, ["A"] = 1 }
updateRecord(p, "B", 1, 2, 3, 4)
-- p = { "A", 1, 2, 3, 4, "B", 1, 2, 3, 4, ["A"] = 1, ["B"] = 6 }
updateRecord(p, "C", 1, 2, 3, 4)
-- p = { "A", 1, 2, 3, 4, "B", 1, 2, 3, 4, "C", 1, 2, 3, 4, ["A"] = 1, ["B"] = 6, ["C"] = 11 }
removeRecord(p, "B")
-- p = { "A", 1, 2, 3, 4, "C", 1, 2, 3, 4, ["A"] = 1, ["C"] = 11 }
--==============================================================================
--
-- oUF_HealComm4
--
-- Uses data from LibHealComm-4.0 to add incoming heal estimate bars onto units
-- health bars.
--
-- * currently won't update the frame if max HP is unknown (ie, restricted to
-- players/pets in your group that are in range), hides the bar for these
-- * can define frame.ignoreHealComm in layout to not have the bars appear on