Skip to content

Instantly share code, notes, and snippets.

View irisfofs's full-sized avatar

Iris irisfofs

View GitHub Profile
@irisfofs
irisfofs / gui-completion.c
Created April 26, 2016 21:26
A snippet containing a small edge case bug.
index2 = (completion->direction < 0) ? index - 1 : index + 1;
while ((index2 >= 0) && (index2 < completion->list->size))
{
ptr_completion_word2 =
(struct t_gui_completion_word *)(completion->list->data[index2]);
if ((ptr_completion_word->nick_completion
&& (gui_completion_nickncmp (completion->base_word,
ptr_completion_word2->word,
length) == 0))
|| (!ptr_completion_word->nick_completion
@irisfofs
irisfofs / junk.js
Created December 4, 2016 00:02
convert equatorial/celestial coodinates to horizontal coordinates
Date.prototype.isLeapYear = function() {
var year = this.getFullYear();
if((year & 3) != 0) return false;
return ((year % 100) != 0 || (year % 400) == 0);
};
// Get Day of Year
Date.prototype.getDOY = function() {
var dayCount = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
@irisfofs
irisfofs / kittens_helpers.js
Last active November 29, 2021 06:49
Quick scripts to help play kittens game because life is short
SECONDS = 1e3;
MINUTES = 60 * SECONDS;
HOURS = 60 * MINUTES;
VERBOSE_AUTO = true;
autocraftNames = ['steel', 'plate'];
mediumCraftNames = ['kerosene', 'thorium', 'eludium'];
slowCraftNames = ['beam', 'slab', 'parchment', 'manuscript'];
scienceCraftNames = ['parchment', 'manuscript', 'compendium'];
religionBuyNames = ['Black Pyramid', 'Black Nexus', 'Black Core'];
require 'net/http'
require 'rubygems'
require 'json'
require 'nokogiri'
require 'fileutils'
require 'fastimage'
require 'ruby-debug'
# ruby ntags.rb output_directory event_id -f format_storage_file
# ruby ntags.rb -e format_storage_file nametag_p1 nametag_p2 ...
@irisfofs
irisfofs / waypoint_converter.js
Last active October 21, 2024 00:14
Converts FTB Chunks waypoints to Xaero's Minimap waypoints.
/**
* To use:
* ```
* ftbJsonToXaeros('paste your waypoints.json contents here');
* ```
* then append to your Xaero's waypoints file(s), located in
* `xaero/minimap/<server name>/<dimension>/mw$default_1.txt`
*/
const MINECRAFT_COLORS = [