Skip to content

Instantly share code, notes, and snippets.

Martin Sloup arcao

Block or report user

Report or block arcao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dns-list.txt
# Google DNS
8.8.8.8
8.8.4.4
# CloudFlare DNS
1.1.1.1
# Quad 9 DNS
9.9.9.9
@arcao
arcao / Arduino StringStream.md
Last active Jul 28, 2018
StringStream class / Library for Arduino
View Arduino StringStream.md

StringStream class / Library for Arduino

This peace of code is usable when you need Stream object which has to store/load data to/from Arduino String object.

Source (StringStream.h)

#ifndef _STRING_STREAM_H_
#define _STRING_STREAM_H_

#include <Stream.h>
@arcao
arcao / Arduino LowPower delay.md
Last active Feb 13, 2017
Delay like function for LowPower Arduino library
View Arduino LowPower delay.md

Delay like function for LowPower Arduino library

Here is delay-like function for Low-Power Arduino library. All delay measurments are performed with ATMega328pu (8MHz internal, 3.3V).

Real delays

  • powerDownDelay(60000) = 60002.256ms
  • powerDownDelay(30000) = 30001.9615ms
  • powerDownDelay(15000) = 15001.783ms
  • powerDownDelay(10000) = 10000.08ms
  • powerDownDelay(5000) = 5000.3095ms
  • powerDownDelay(2000) = 2007.191ms
@arcao
arcao / dht&rc_mqtt.ino
Last active Jan 28, 2017
Improved biacz version (original: https://gist.github.com/biacz/5ad2f56b3d055a3fc7ac700c7bc7a294). Switching lights are postponed to perform together.
View dht&rc_mqtt.ino
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <DHT.h>
#include <ArduinoJson.h>
#include <RCSwitch.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266httpUpdate.h>
#include <Ticker.h>
// WiFi config
View keybase.md

Keybase proof

I hereby claim:

  • I am arcao on github.
  • I am arcao (https://keybase.io/arcao) on keybase.
  • I have a public key whose fingerprint is E2F2 D1E5 C999 21F9 1FA1 859A 3B94 38F2 74FC D3D4

To claim this, I am signing this object:

@arcao
arcao / build.gradle
Last active Aug 23, 2017
Run JarJar task to repackage Gson library in Android Gradle build script
View build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.0'
}
}
apply plugin: 'com.android.application'
@arcao
arcao / gist:6491762
Created Sep 9, 2013
Parse JSON Date created by .NET, for example: /Date(1378670400000-0500)/
View gist:6491762
protected static Date parseJsonDate(String date) {
Pattern DATE_PATTERN = Pattern.compile("/Date\\((-?\\d+)([-+]\\d{4})?\\)/");
Matcher m = DATE_PATTERN.matcher(date);
if (m.matches()) {
long time = Long.parseLong(m.group(1));
long zone = 0;
if (m.group(2) != null && m.group(2).length() > 0)
zone = Integer.parseInt(m.group(2)) / 100 * 1000 * 60 * 60;
You can’t perform that action at this time.