Skip to content

Instantly share code, notes, and snippets.

View warmist's full-sized avatar
💭
Making a game or sth

Warmist warmist

💭
Making a game or sth
View GitHub Profile
@warmist
warmist / todo.md
Last active February 25, 2016 11:01
DF todo
  1. gods in df -> moved to word doc
  2. figure out book interactions, give some fun stuff to random books (e.g. paralysis)
  3. finish unit creation script- mostly done, needs some minor fixes do it in c++
  4. site creation done, could use some more love.
  5. finish the lua-scripted reactions (including the god worshiping mini-mod, altars (with statue req) and mini altars with figurines?) done- eventful
  6. genetic engineering by adding generated creature raws
  7. jobs in adv mode (esp. build/dig) - almost done advfort
  8. anti-quantum stockpile mod
  9. Df achievements and stats(longest toss, most hurt unit, cheapest artifact). Per world and could be added to fortmode/advmode/legends menu
  10. maybe it's possible to add rust (new material that sometimes adds wear to item and a layer of rust/patina, maybe it inhibits later additions)
@warmist
warmist / vmethods.rst
Last active June 22, 2022 16:32
DF usefull vmethods.
Items:
  • incrementRotTimer
  • addImprovementFromJob
  • moveToGround
  • categorize
  • addWear/incWearTimer/setWear
  • addContaminant/removeContaminant/removeContaminantByIdx
  • contaminateWound
  • coverWithContaminant
  • becomePaste/becomePressed
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@jdkanani
jdkanani / notepad.html
Last active April 6, 2024 17:09 — forked from jakeonrails/Ruby Notepad Bookmarklet
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
@mmozeiko
mmozeiko / win32_crt_float.cpp
Last active February 16, 2024 14:24
Visual C/C++ CRT functionality
extern "C"
{
int _fltused;
#ifdef _M_IX86 // following functions are needed only for 32-bit architecture
__declspec(naked) void _ftol2()
{
__asm
{
@imneme
imneme / randutils.hpp
Last active March 28, 2024 20:43
Addresses common issues with C++11 random number generation; makes good seeding easier, and makes using RNGs easy while retaining all the power.
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Melissa E. O'Neill
*
#pragma once
// This provides a library for stubbing and mocking C++ code as is. It works by requiring
// explicit hooks to be inserted into the code that is to be mocked. In a regular build,
// these hooks will do nothing. In a testing build, they will expand to calls into the
// framework here to allow the code being executed to be hijacked from outside.
//
// NOTE: Thread-safety! Arranging fakes must be done on a single thread. Using fakes can
// be done from multiple threads concurrently.
//
@aras-p
aras-p / test.txt
Last active November 2, 2022 23:26
Markdeep Admonition style blocks?
Right now I can do this in Markdeep source:
------------------
Just a test paragraph, move along...
<div class="note">
Just a note. Don't mind me.
</div>
<div class="warn">
@beesandbombs
beesandbombs / starTorus.pde
Created September 5, 2018 22:57
star torus
// "star torus" by davey
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@d7samurai
d7samurai / .readme.md
Last active March 27, 2024 17:50
Minimal D3D11 pt2

Minimal D3D11 pt2

Follow-up to Minimal D3D11, adding instanced rendering. As before: An uncluttered Direct3D 11 setup & basic rendering primer / API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion. No modern C++ / OOP / obscuring cruft.

The main difference here is that the hollow cube is rendered using DrawIndexedInstanced (which saves a lot of vertices compared to the original, so model data is now small enough to be included in the source without being too much in the way), but also all trigonometry and matrix math is moved to the vertex shader, further simplifying the main code.

Each instance is merely this piece of geometry, consisting of 4 triangles:

instanced1

..which is th