Skip to content

Instantly share code, notes, and snippets.

View cerealcable's full-sized avatar

Morgan cerealcable

View GitHub Profile
@cerealcable
cerealcable / automation.yml
Last active November 6, 2023 18:05
Home Assistant configuration, dashboard and automation for GenMon via MQTT with notifications
alias: Generator State Notifications
description: ""
trigger:
- platform: state
entity_id:
- sensor.generator_engine_state
condition:
- condition: template
value_template: "{{ trigger.from_state.state != 'unavailable' }}"
action:
[Desktop Entry]
Name=Nexus Wallet
Exec=/usr/local/Nexus-Qt/nexus-qt
Icon=nexus
Terminal=false
Type=Application
Categories=Utility;Application;

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@cerealcable
cerealcable / Main.java
Created July 26, 2011 22:38
Mutator Test Class
package testapp;
public class Main {
public static void main(String[] args) {
MyClass o = new MyClass(1243.91);
Long start1 = System.nanoTime();
for(int i = 0; i < 10000; i++) {
Double value = o.getValue();
@cerealcable
cerealcable / gist:1042893
Created June 23, 2011 16:18
Null tests
import java.util.Map;
public class Main {
public static void main(String[] args) {
Map<Object,Object> map;
if(map == null) {
System.out.println("test");