This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"errors" | |
sqldriver "database/sql" | |
"github.com/hallgren/eventsourcing" | |
"github.com/davecgh/go-spew/spew" | |
"github.com/hallgren/eventsourcing/eventstore/sql" | |
"github.com/hallgren/eventsourcing/serializer/unsafe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"database/sql" | |
"fmt" | |
_ "github.com/mattn/go-sqlite3" | |
"log" | |
"context" | |
"time" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
välta koner | |
https://www.youtube.com/watch?v=041_Rmr2JvU | |
vulkan | |
https://www.youtube.com/watch?v=JI9eHcBAYK4 | |
blandade övningar | |
https://www.youtube.com/watch?v=Yr_AqMLGD4s | |
tips |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ash | |
# MQTT SETTINGS | |
host="<mqtt_broker_url>" | |
user="<user>" | |
password="<password>" | |
port=1883 | |
topic="<topic>" | |
#ONION OMEGA2 GPIO PID SETTING | |
io_pid=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ash | |
# MQTT SETTINGS | |
host="<mqtt_broker_url>" | |
user="<user>" | |
password="<password>" | |
port=1883 | |
topic="<topic>" | |
#ONION OMEGA2 GPIO PID SETTING | |
io_pid=6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* -------------------------------------------------------------------------------------------------------------------- | |
* Example sketch/program showing how to read data from a PICC to serial. | |
* -------------------------------------------------------------------------------------------------------------------- | |
* This is a MFRC522 library example; for further details and other examples see: https://github.com/miguelbalboa/rfid | |
* | |
* Example sketch/program showing how to read data from a PICC (that is: a RFID Tag or Card) using a MFRC522 based RFID | |
* Reader on the Arduino SPI interface. | |
* | |
* When the Arduino and the MFRC522 module are connected (see the pin layout below), load this sketch into Arduino IDE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaks mapper | |
class UserMapper < Yaks::Mapper | |
link :self, '/api/admin/users/{user_guid}' | |
link :admin_users, '/api/admin/users' | |
link :toolbox_specific_accesses, '/api/admin/users/{user_guid}/toolbox_specific_accesses' | |
link :regions, '/api/admin/users/{user_guid}/region', if: ->{ object.regions } | |
link :plants, '/api/admin/users/{user_guid}/plant', if: ->{ object.plants } | |
has_many :regions, if: ->{ object.regions } | |
has_many :plants, if: ->{ object.plants } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaks mapper | |
form :make_admin, if: -> { !object.admin? && !object.my_self? } do | |
action '/api/admin/users/{user_guid}' | |
method 'POST' | |
media_type 'application/json' | |
hidden :action, value: -> { 'make_admin' } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//KnockoutJS - Jquery UI binding depending on RXJS library | |
// | |
//Example of usage | |
//<div data-bind='template: { name: "tmpl", foreach: items, afterAdd: function(elem){ $(elem).trigger("valueChanged");} }, jqAccordion: {}'/> | |
ko.bindingHandlers.jqAccordion = { | |
init: function(element, valueAccessor) { | |
var options = valueAccessor(); | |
var jqElement = $(element); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ko.bindingHandlers['rvalue'] = { | |
'init': function (element, valueAccessor, allBindingsAccessor) { | |
var value = ko.utils.unwrapObservable(valueAccessor()); | |
ko.selectExtensions.writeValue(element, value); | |
} | |
}; |
NewerOlder