Skip to content

Instantly share code, notes, and snippets.

@sisomm
sisomm / lever_pulled_mqtt.js
Last active Jan 4, 2016
How to send changes to a lever in Minecraft to a MQTT broker - and listen for changes in an Arduino
View lever_pulled_mqtt.js
var mqtt = require('sc-mqtt');
var client = mqtt.client(); // local host is default. Otherwise use host, user/pwd
client.connect();
//Subscribe to changes in the state of the Arduino
client.subscribe('/arduino/1/status');
var player; // To remember who pulled the switch
// Here we tell Minecraft to give us control after certain events
events.on('player.PlayerInteractEvent', function (listener, event) {
@karlhorky
karlhorky / css-is-complex.md
Last active Feb 4, 2021
CSS is Complex. We can do better.
View css-is-complex.md

CSS is Complex. We can do better.

Posted on https://twitter.com/karlhorky/status/1082622697325166592

Ok, thread time.

CSS is unnecessarily complex. And we can do better.

There have been side conversations here and there, but I want to consolidate the information and opinions here. This will be a running thread, and I'll add to it as new things crop up.

@Mithrandir0x
Mithrandir0x / gist:3639232
Created Sep 5, 2012
Difference between Service, Factory and Provider in AngularJS
View gist:3639232
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"