Skip to content

Instantly share code, notes, and snippets.

View fregmented's full-sized avatar
🌌

HanWool Lee fregmented

🌌
View GitHub Profile
@fregmented
fregmented / template.yaml
Created February 6, 2022 06:35
Hass Template sensor for average T/H
template:
- sensor:
- name: "Average temperature"
unique_id: avrg_temperature
unit_of_measurement: "°C"
state: >
{% set bedroom = states('sensor.anbang_t_h_temperature') | float %}
{% set kitchen = states('sensor.kitchen_temperature') | float %}
{% set living = states('sensor.geosil_temperature') | float %}
int main(int argc, char *argv[]) {
// BLAHBLAH
UART_eSetRTS(iUartFd, 1); // nRESET
UART_eSetDTR(iUartFd, 1); // nPROG
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 100000000; // 100 ms
nanosleep(&ts, NULL);
UART_eSetRTS(iUartFd, 0); // nRESET
ts.tv_sec = 0;
@fregmented
fregmented / skplanet_weather.py
Last active February 19, 2018 11:04
SK플래닛 Weather Planet에서 날씨정보 받아오는 파이썬 스크립트입니다. 기상청 AWS station명으로 분단위 실시간 기상정보를 받아옵니다.
from requests import get
from enum import IntEnum
SK_PLANET_APP_KEY = "KEEEEEEY"
class Stations(IntEnum):
def __str__(self):
return "{}".format(self.value)
source
```
switch(integerA){
case 0:
method1();
case 1:
method2();
break;
default:
@fregmented
fregmented / AllSensorSample
Last active November 26, 2015 04:06
AllSensorSample.java
private boolean isAmbient_temp = false;
private boolean isMagnetic = false;
private HashMap<Integer, float[]> sensorValues = new HashMap<>();
public void onSensorChanged(SensorEvent event) {
switch (event.sensor.getType()){
case Sensor.TYPE_AMBIENT_TEMPERATURE:
// blah blah
sensorValues.put(Sensor.TYPE_AMBIENT_TEMPERATURE, event.values);
isAmbient_temp = true;
break;
@fregmented
fregmented / stacktrace.java
Created October 3, 2015 16:38
Youtrack GitLab integration stacktrace
16:03:50,474 WARN [TransactionalResourceFilter ] [tp1530388690-16] [HanWool@220.123.69.35] Can't commit rest transaction
jetbrains.youtrack.integration.github.rest.JerseyClientExceptionWrapper: javax.ws.rs.NotFoundException: HTTP 404 Not Found
at jetbrains.youtrack.integration.github.rest.BitBucketRest.post(BitBucketRest.java:201)
at jetbrains.youtrack.integration.github.rest.GitLabRest.createHook(GitLabRest.java:72)
at jetbrains.youtrack.integration.github.persistence.GitLabChangesProcessorImpl.doCreateHook(GitLabChangesProcessorImpl.java:38)
at jetbrains.youtrack.integration.github.persistence.GithubCloneChangesProcessorImpl.createHook(GithubCloneChangesProcessorImpl.java:74)
at jetbrains.youtrack.integration.github.persistence.GithubRepoChangesListener.addedSyncBeforeConstraints(GithubRepoChangesListener.java:26)
at jetbrains.teamsys.dnq.runtime.events.EventsMultiplexer.handleChange(EventsMultiplexer.java:297)
at jetbrains.teamsys.dnq.runtime.events.EventsMultiplexer.handlePerEntityTypeChanges(Ev
seyrizui-Mac-mini:SUGARAIN seyriz$ ./gradlew --parallel --stacktrace assemble
Parallel execution is an incubating feature.
:app:preBuild
:xmlrpc:compileLint
:robotoCalendarLibrary:compileLint UP-TO-DATE
:robotoCalendarLibrary:copyReleaseLint
:app:preDebugBuild
:xmlrpc:copyReleaseLint UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:robotoCalendarLibrary:copyReleaseLint UP-TO-DATE
## Url on which GitLab will be reachable.
## For more details on configuring external_url see:
## https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#configuring-the-external-url-for-gitlab
external_url ''
## Note: configuration settings below are optional.
## Uncomment and change the value.
############################
# gitlab.yml configuration #
server {
listen 80;
server_name domain;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:[dest-post];
}
}
2015-04-12 02:34:11,229 [1765019] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
2015-04-12 02:34:11,229 [1765019] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
2015-04-12 02:34:11,230 [1765020] INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at '/Applications/Android Studio.app/Contents/gradle/m2repository'
2015-04-12 02:34:11,231 [1765021] INFO - .project.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: [-Pandroid.injected.build.model.only=true, -Pandroid.injected.build.model.only.advanced=true, -Pandroid.injected.invoked.from.ide=true, --init-script, /private/var/folders/w0/pbg93bm92wq3n0__t0n3ynl00000gn/T/asLocalRepo2055788470259646157.gradle, --init-script, /private/var/folders/w0/pbg93bm92wq3n0__t0n3ynl00000gn/T/ijinit3434146205477802898.gradle]
2015-04-12 02: