Skip to content

Instantly share code, notes, and snippets.

View MarinusLeeuwerik's full-sized avatar

Marinus Leeuwerik MarinusLeeuwerik

View GitHub Profile
@MarinusLeeuwerik
MarinusLeeuwerik / Arduinointerface
Created April 4, 2015 15:41
Arduino interface project Bytronic
/* Interface v2 */
// //
// //
// //
// //
/* Gemaakt door Marinus Leeuwerik */
#include <IRremote.h>
#include <LiquidCrystal.h>
@MarinusLeeuwerik
MarinusLeeuwerik / SMTP.java
Last active August 29, 2015 14:02
This class enables you to send emails using java applications.
package code.MarinusLeeuwerik.utils;
/**
* Copyright (c) 2014 Xiaomao Chen @ IvyBits
* All rights reserved.
*
* (Modified version by MarinusLeeuwerik)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
@MarinusLeeuwerik
MarinusLeeuwerik / GetItemAmount.java
Last active August 29, 2015 14:01
Get amount of the specified item in one's inventory. Simple, but efficient.
package code.MarinusLeeuwerik.utils
public class GetItemAmount {
public int getItemAmount(Inventory inventory, Material... search) {
List<Material> wanted = Arrays.asList(search);
int amount = 0;
for(ItemStack item : inventory.getContents()) {
@MarinusLeeuwerik
MarinusLeeuwerik / InventorySerialization.java
Last active August 29, 2015 14:01
Base64 inventory serialization with NTB (Named Binary Tag).
package code.MarinusLeeuwerik.utils;
/**
* Copyright (c) 2014 Marinus Leeuwerik
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.