Skip to content

Instantly share code, notes, and snippets.

View aergonaut's full-sized avatar

Chris Fung aergonaut

View GitHub Profile
# typed: true
# frozen_string_literal: true
require('dev')
require('fileutils')
module Dev
module Helpers
class APFSVolume
extend(T::Sig)
@castwide
castwide / rails.rb
Last active April 27, 2024 08:54
Enhance Rails Intellisense in Solargraph
# The following comments fill some of the gaps in Solargraph's understanding of
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
# ignored at runtime.
#
# You can put this file anywhere in the project, as long as it gets included in
# the workspace maps. It's recommended that you keep it in a standalone file
# instead of pasting it into an existing one.
#
# @!parse
# class ActionController::Base
@rosskevin
rosskevin / relay.js
Last active June 27, 2018 01:07
flow libdef for relay modern 1.2. This is in a _works for me_ state. Someone please export these properly from relay or create a proper flow-typed libdef.
// @flow
declare module 'react-relay' {
declare export type RecordState = 'EXISTENT' | 'NONEXISTENT' | 'UNKNOWN';
declare export type onCompleted = (response: ?Object, errors: ?Array<PayloadError>) => void
declare export type onError = (error: Error) => void
declare export type CommitOptions = {
onCompleted: onCompleted,
#!/usr/bin/env ruby
class A
def b
'b'
end
end
module X
def b
@nornagon
nornagon / 1-intro.md
Last active April 20, 2024 18:48
How to make a Minecraft (1.8) mod

How to make a Minecraft mod

Minecraft mods, especially mods which change the client, are by and large written with Forge. If you visit their website, you'll be greeted abruptly by a mysterious message at the top of an SMF forum, with no clear path towards actually... making a mod. I'm documenting here the steps I went through to get started, in the hopes of helping the next person have an easier time of it.

I'll be using Scala for this guide, but it should be fairly easy to adapt these instructions to any JVM language (e.g. clojure or if you're feeling masochistic, Java). I'm also developing on OS X, so some of the commands will be a little different if you're on Linux or Windows. I'm assuming you have some proficiency with your operating system, so I won't go into details about how to adapt those commands to your system.

Background

Minecraft doesn't have an official mod API (despite early [promises](http://notch.t

@Vazkii
Vazkii / Message.java
Last active March 8, 2021 20:37
Plug'n'Play Packet System
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Psi Mod. Get the Source Code in github:
* https://github.com/Vazkii/Psi
*
* Psi is Open Source and distributed under the
* CC-BY-NC-SA 3.0 License: https://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB
*
* File Created @ [11/01/2016, 22:00:30 (GMT)]
*/
@mjackson
mjackson / app.js
Created December 29, 2015 05:07
Using webpack with pixi.js
var PIXI = require('pixi.js')
console.log(PIXI)
@hamin
hamin / example.rb
Last active August 29, 2015 14:26
An updated Rust 1.x version of Yehuda's Native Rust Extension post here http://blog.skylight.io/bending-the-curve-writing-safe-fast-native-gems-with-rust/
require "./points"
p1 = RustPoint::make_point(10, 10) # => #<Fiddle::Pointer:0x007f8231e56510 ptr=0x0000010b824000 size=0 free=0x00000000000000>
p2 = RustPoint::make_point(20, 20) # => #<Fiddle::Pointer:0x007f8231f20970 ptr=0x0000010b824010 size=0 free=0x00000000000000>
RustPoint::get_distance(p1, p2) # => 14.142135623730951
@varemenos
varemenos / 1.README.md
Last active April 21, 2024 23:21
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit

A small sampling of external projects initially built for Ember use but designed to be used standalone: