Skip to content

Instantly share code, notes, and snippets.

Mithrandir0x / gist:3639232
Created Sep 5, 2012
Difference between Service, Factory and Provider in AngularJS
View gist:3639232
// Source:!topic/angular/hVrkvaHGOfc
// jsFiddle:
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
karlhorky /
Last active Feb 4, 2021
CSS is Complex. We can do better.

CSS is Complex. We can do better.

Posted on

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.

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
//Subscribe to changes in the state of the Arduino
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) {