Skip to content

Instantly share code, notes, and snippets.

View mwittig's full-sized avatar

Marcus Wittig mwittig

  • Berlin/Brandenburg, Germany
  • 22:14 (UTC +02:00)
View GitHub Profile
action: (deviceId, actionName, params) ->
id = '' + @_getActionId()
p = if params? then params else {}
p.deviceId = deviceId
p.actionName = actionName
new Promise (resolve, reject) =>
@socket.emit 'call', {
id: id,
action: 'callDeviceAction',
params: p
@mwittig
mwittig / _Notes.md
Last active July 29, 2016 09:36
Openweather Intermittent Wrong Temperature Values Issue (search for "temp":7)

Observations

The response data seems to originate from different source referred to by property "base" in the data record. What I noticed is that the bogus 7 degrees temperature values always originate from "base": "stations" while "base": "cmc stations" seem to provide correct values all times. It should also be noted that "base": "stations" sometimes provides correct values.

@mwittig
mwittig / write_data_1.csv
Created January 9, 2017 16:49 — forked from rakeshsukla53/write_data_1.csv
donald trump quotes
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 7.
Donald Trump,Quotes
Sometimes by losing a battle you find a new way to win the war.,http://www.brainyquote.com/quotes/quotes/d/donaldtrum383171.html
I have a great relationship with the Mexican people.,http://www.brainyquote.com/quotes/quotes/d/donaldtrum717755.html
"You have to think anyway, so why not think big?",http://www.brainyquote.com/quotes/quotes/d/donaldtrum153798.html
"You know the funny thing, I don't get along with rich people. I get along with the middle class and the poor people better than I get along with the rich people.",http://www.brainyquote.com/quotes/quotes/d/donaldtrum414743.html
"Our politicians are stupid. And the Mexican government is much smarter, much sharper, much more cunning. And they send the bad ones over because they don't want to pay for them. They don't want to take care of them. Why should they when the stupid leaders of the United States will do it for them?",http://www.brainyquote.com/quotes/quotes/d/donaldtrum714310.html
"That's one of the nice things. I mean, part of
@mwittig
mwittig / plugin-stats-may-2019.md
Last active June 26, 2019 12:51
Plugin Stats
package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
"testing"
)
@mwittig
mwittig / typecheck_test.go
Last active December 15, 2022 20:18
Benchmark TypeSwitch vs. Reflect vs fmt.Sprintf performance compare two value for type equality
package reflectperf
import (
"fmt"
"reflect"
"testing"
)
// Note, switchTest produces a different result for nil, nil then reflectTest and sprintfTypeTest.
// However, this case is not part of the tests performed.