Skip to content

Instantly share code, notes, and snippets.

View ccjmk's full-sized avatar
🏠
Working from home

ccjmk ccjmk

🏠
Working from home
View GitHub Profile
@ccjmk
ccjmk / fvtt-factory-ghost-preset-tailwindcss.md
Last active January 15, 2022 16:51
Adding TailwindCSS to Foundry Factory's Ghost preset

Adding Tailwind to Ghost's Foundry Factory preset.

  1. Added a templates folder (its on the gulpfile, could be handy to have the folder already created by the preset)
  2. created a little TestApp with a test template:
<!-- on src/templates/app.html -->
<div>
    <p>Hello World</p>
</div>
@ccjmk
ccjmk / turn_defeated_into_loot.js
Created December 15, 2020 20:56
FoundryVTT script macro for turning dead NPCs into lootables, using fvtt-loot-sheet-npc-5e - works best with a CUB Triggler trigger for NPCs dropping to hp <= 0
(async () => {
let defeated = canvas.tokens.placeables.filter(t => {
return t.data.disposition === -1 && t.data.actorData.data?.attributes?.hp?.value <= 0
});
for (let token of defeated) {
if (token.actor.data.type != 'npc')
continue;
let invalid = await token.getFlag(`world`,`lootyfied`) ? await token.getFlag(`world`,`lootyfied`) : false;
// FROM Jenthura ( https://github.com/jenthura/foundryVTT5eConditionRulesMacro/blob/master/ConditionRulesMacro.js )
function postToChat(conditionName, imgURL, message){
let chatData = {
user: game.user._id,
speaker: {alias: "Conditions"},
content: `<div class="dnd5e chat-card" style="text-align: center"><header class="card-header flexrow"><h3 class="item-name">${conditionName}</h3></div><br><div style="text-align: center"><img width=75% height=50% src="${imgURL}"</img></div><br>${message}`
};
ChatMessage.create(chatData, {});
};
@ccjmk
ccjmk / clase2.c
Last active August 29, 2015 13:57
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct vertex
{
int data;
struct edge *edge;
struct vertex *next;
} graphNode;
@ccjmk
ccjmk / MergeSort
Created May 22, 2013 19:40
MergeSort sorting algorithm written in C with recursive functions.
#include <stdio.h>
#include <stdlib.h>
void mergesort(int a[],int low,int high);
void merge(int a[], int low, int high);
int main()
{
int a[40],fin,i;
printf("ingrese dim\n");