Skip to content

Instantly share code, notes, and snippets.

View marvin-roesch's full-sized avatar

Marvin Rösch marvin-roesch

  • Germany
  • 15:25 (UTC +01:00)
View GitHub Profile
@marvin-roesch
marvin-roesch / _README.md
Created October 21, 2017 19:05
A simple scraping and analysis script to get programming language data from CurseForge projects. Includes the latest dump.

Curse Language Statistics

These are two simple Python scripts to gather some basic data about Minecraft mods on CurseForge. curselangs.py scrapes the project listing, while curselangs-stats.py evaluates the scraped data and outputs some accumulated results. Mind you that I'm far from a Python expert, so the scripts might not be the most well written.

In order to save you the effort of scraping, I've dumped the latest 1.12 data (as of 2017-10-21) in a separate Gist.

The evaluated data is visualized in a Google Spreadsheet.

@marvin-roesch
marvin-roesch / code-style.xml
Created September 17, 2016 15:49
Paper Karma Babies IntelliJ IDEA code style
<code_scheme name="PaperKarmaBabies">
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value>
<package name="org.lwjgl.GL11.*" withSubpackages="false" static="true" />
</value>
</option>
<codeStyleSettings language="JAVA">
<option name="RIGHT_MARGIN" value="150" />
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
@marvin-roesch
marvin-roesch / code-style.xml
Created May 20, 2016 21:10
Vanilla Immersion Code Style Settings for IntelliJ IDEA
<code_scheme name="VanillaImmersion">
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value>
<package name="org.lwjgl.GL11.*" withSubpackages="false" static="true"/>
</value>
</option>
<codeStyleSettings language="kotlin">
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true"/>
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true"/>
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true"/>
@marvin-roesch
marvin-roesch / Color.scala
Created July 30, 2015 21:32
Color cycling
object Color {
def black(alpha: Float) = this(0, 0, 0, alpha)
def fromHSV(hue: Float, saturation: Float, value: Float): Color = fromHSV(hue, saturation, value, 1)
def fromHSV(hue: Float, saturation: Float, value: Float, alpha: Float): Color = apply(java.awt.Color.HSBtoRGB(hue, saturation, value), alpha)
def apply(hex: Int): Color = {
val r = ((hex >> 16) & 0xFF) / 255F
val g = ((hex >> 8) & 0xFF) / 255F
@marvin-roesch
marvin-roesch / .gitignore
Created June 30, 2015 20:04
Generic MC mod .gitignore
/*
!/gradle/
!/gradle/*
!/gradle*
!/src/
!/src/*
!/build.gradle
!/*.md
!/LICENSE
!/.gitignore
class BlockRift extends BaseBlock(Names.Blocks.Rift, Core.CreativeTab, Material.rock) with TileProvider[TileRift] with TileRendering[TileRift] {
initTileProvider()
initTileRendering()
}
trait TileProvider[T <: TileEntity] extends BaseBlock {
this: TileProvider[T] =>
def initTileProvider()(implicit ev: ClassTag[T]): Unit = {
_clazz = ev.runtimeClass.asInstanceOf[Class[T]]
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
@marvin-roesch
marvin-roesch / NetworkHelper
Last active January 2, 2016 01:08
OpenGuiHandler
package de.mineformers.drash.util;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import de.mineformers.drash.DRASH;
@marvin-roesch
marvin-roesch / BlockCable
Created December 26, 2013 16:05
Connection checking example
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int newId) {
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
if (world.getBlockTileEntity(x + side.offsetX, y + side.offsetY, z + side.offsetZ) instanceof TileCable) {
TileCable tile = (TileCable) world.getBlockTileEntity(x + side.offsetX, y + side.offsetY, z + side.offsetZ);
tile.checkConnections();
}
}
}