Skip to content

Instantly share code, notes, and snippets.

View shadowfacts's full-sized avatar
🖕
stop turning github into a social network, micro$oft

Shadowfacts shadowfacts

🖕
stop turning github into a social network, micro$oft
View GitHub Profile

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
float f = 0.5F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
@shadowfacts
shadowfacts / konami.js
Created April 15, 2015 01:32
jQuery Konami code detector
/*!
* SimpleKonami
* Copyright: WTFPL
* Version: 1
* Requires: jQuery v1.3.2 or later
*/
//Set up our array of needed keys, and variables.
neededkeys = [38,38,40,40,37,39,37,39,66,65], started = false, count = 0;
$(document).keydown(function(e){
@shadowfacts
shadowfacts / .gitignore
Created April 25, 2015 01:56
Objective-C .gitignore
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
@shadowfacts
shadowfacts / .gitignore
Created June 5, 2015 01:49
Java/Gradle gitignore
# gradle
/.gradle
/build
# eclipse
/eclipse
/.settings
/.metdata
/.classpath
/.project
@shadowfacts
shadowfacts / 7.java
Created July 17, 2015 23:32
Java 8 lambda example
Runnable thingy = new Runnable() {
public void run() {
System.out.println("Annonymous class");
}
}
somethingElse(thingy);
@shadowfacts
shadowfacts / Class1.java
Created July 30, 2015 23:34
Java 8 Interface Defaults example
package net.shadowfacts.example;
/**
* A class that implements Interface1 but only has one custom value.
**/
public class Class1 implements Interface1 {
public String name() {
return "Class1";
}
[14:31:53] [Client thread/INFO] [ShadowJS]: Evaluating includes
[14:31:54] [Client thread/INFO] [ShadowJS]: Evaluating main.js
1xtile.stone@0
1xtile.stonebrick@0
@shadowfacts
shadowfacts / .txt
Created August 24, 2015 13:25
Events!
A block has been placed!
The event is:
net.minecraftforge.event.world.BlockEvent$PlaceEvent@4f530fe