Skip to content

Instantly share code, notes, and snippets.

View gistya's full-sized avatar

Jon Gilbert gistya

  • Portland, OR
View GitHub Profile
@gistya
gistya / implicitMemberLookupFTypePlayground.swift
Created July 4, 2026 16:39
Implicit member syntax through a function type — adversarial playground
// =============================================================================
// Implicit member syntax through a function type — adversarial playground
// =============================================================================
//
// Feature: a leading dot whose contextual type is a function type `(P...) -> R`
// also considers static members of the return type `R` (enum case constructors,
// static factories). i.e. `.b` may mean `R.b` when `R.b : (P...) -> R`.
//
// Build (feature ON):
// swiftc -typecheck -enable-experimental-feature ImplicitMemberOnFunctionType \
protocol BulkIterator {
associatedtype Element
associatedtype Failure: Error = Never
mutating func nextSpan(maximumCount: Int) throws(Failure) -> Element
}
protocol Iterable where Iterator.Failure == Failure, Iterator.Element == Element {
associatedtype Element
associatedtype Failure: Error = Never
associatedtype Iterator: BulkIterator
@gistya
gistya / filterByNumberOfFarmableBiomes.html
Last active March 29, 2024 02:53
Filter by number of farmable biomes in system
// add at line 5:
<select name="NumberOfFarmBiomes" id="NumberOfFarmBiomes">
<option value="-NumberOfFarmBiomes-">-NumberOfFarmBiomes-</option>
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
@gistya
gistya / A007978_0_720720.txt
Last active October 26, 2022 00:51
A007978 (least non-divisor of n) for 1 through 720,720
This file has been truncated, but you can view the full file.
You're not gonna get
the satisfaction of a
"username confirmed"
@gistya
gistya / gist:d9263a03539866e6fcbabbf4afaa0dc2
Last active May 19, 2017 18:32
Rebel's Guide to No Man's Sky 1.00 (RC1) (Guide Version 0.91b)
A rebel's guide to No Man's Sky 1.0 (RC1)
Guide version 0.91b
by /u/gistya
Intro:
Below I present to you my guide to No Man's Sky 1.0 (RC1). It was written around the time Foundation update came out, because I went back to 1.00 due to my jetpack getting attached to my ship multiple times. But I held off from publishing it for awhile.
However lately I have started seeing more and more posts from people on Reddit who seem to be getting into 1.00, so I figured it would be a good time to post this guide, since there seems to be interest. Please let me know at gistya@gmail.com if anything seems to be missing from the guide.
Disclaimer: I'm a software developer by day, so I tried to approach this from a developer's point of view and not throw Hello Games under the bus for anything. In fact I was shocked at how great 1.00 was, and it made me realize how most of the things that people on reddit were whining about prior to launch were actually not problems at all, and in fact the release version made the game wors
@gistya
gistya / gist:6292bc9f57e9c56469b1
Last active January 13, 2016 07:28
clangFoo! Makes -ObjC flag unnecessary by faking clang into linking classes from a j2objc static library your transpiled code wants to dynamically load but otherwise can't during runtime
/** by Jon Gilbert gistya at gmail **/
/** NoObjCLinkerFlag.h **/
#import <Foundation/Foundation.h>
/*!@description Call this function once from somewhere in your lib, and the compiler
will be tricked into loading the classes mentioned in clangFoo below. */
void preloadXalanDynamicLoads();
/Users/sdf/Documents/dev/j2objc/jre_emul/build_result/Classes/org/apache/xalan/templates/TemplateList.m:410:192: warning: comparison of distinct pointer types
('OrgApacheXpathObjectsXObject *' and 'OrgApacheXpathObjectsXNumber *') [-Wcompare-distinct-pointer-types]
...[((OrgApacheXpathPatternsStepPattern *) nil_chk(head->m_stepPattern_)) executeWithOrgApacheXpathXPathContext:xctxt withInt:targetNode withOrgApacheXmlDtmDTM:dtm withInt:expTypeID] != JreLoadStatic(OrgApacheXpathPatternsNodeTest, SCORE_NONE)...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/sdf/Documents/dev/j2objc/jre_emul/build_result/Classes/org/apache/xalan/templates/TemplateList.m:436:149: warning: comparison of distinct pointer types
('OrgApacheXpathObjectsXObject *' and 'OrgApacheXpathObjectsXNumber *') [-Wcompare-distinct
j2objc -d ~/dev/xalan/dev/xalan-ios -classpath ~/dev/java_src/xalan-j_2_7_2/lib -classpath /Library/Java/JavaVirtualMachines/jdk1.8.
0_65.jdk/Contents/Home/lib/tools.jar -encoding UTF-8 -sourcepath ~/dev/java_src/xalan-j_2_7_2/src $(find ~/dev/java_src/xalan-j_2_7_2/src -name *.java) | grep error
error: /Users/jjj/dev/java_src/xalan-j_2_7_2/src/org/apache/xalan/client/XSLTProcessorApplet.java:23: The import java.applet cannot be resolved
error: /Users/jjj/dev/java_src/xalan-j_2_7_2/src/org/apache/xalan/client/XSLTProcessorApplet.java:24: The import java.awt.Graphics cannot be resolved
error: /Users/jjj/dev/java_src/xalan-j_2_7_2/src/org/apache/xalan/client/XSLTProcessorApplet.java:62: Applet cannot be resolved to a type
error: /Users/jjj/dev/java_src/xalan-j_2_7_2/src/org/apache/xalan/client/XSLTProcessorApplet.java:215: The method getParameter(String) is undefined for the type XSLTProcessorApplet
error: /Users/jjj/dev/java_src/xalan-j_2_7_2/src/org/apache/xalan/client/XSLTProcessorApplet.java:225: The method
@gistya
gistya / regextest.cpp
Created January 5, 2016 19:16 — forked from edhemphill/regextest.cpp
ICU4C regex example test program w/ capture groups
// http://www.wigwag.com/devblog/using-icu4c-regex-test-program/
// The following code is freeware:
// regextest.c
// Author: ed
//
// Simple test program for regex using ICU's regex matching.
#include <stdio.h>
#include <getopt.h>
#include <string.h>