Skip to content

Instantly share code, notes, and snippets.

@abrhm
abrhm / arduino.cpp
Created April 28, 2019 17:21
Arduino solar panel controller
#include <OneWire.h>
#include <DallasTemperature.h>
struct TempSensor {
OneWire wire;
DallasTemperature sensor;
DeviceAddress address;
TempSensor(const uint8_t pin)
: wire(pin) {
@abrhm
abrhm / mystra_champion.md
Last active October 15, 2018 20:52
Way of Mystra Champion - Monk archetype

Way of Mystra Champion

  • Level 3: Apprentice of magic: You gain the Mage slayer feat, additionally you gain proficiency in Arcana skill if you don't already have it.
  • Level 6: Adept of magic: You can cast Identify and Detect magic for 2 ki point.
  • Level 11: Expert of magic: As a reaction, you can use Counterspell or Dispel Magic for as least 4 ki point (1 additional ki point for higher level). This reaction cannot be counterspelled.
  • Level 17: Master of magic: As a reaction you can attempt to steal a spell being casted within 30 feet of you. You spend ki points equal to the spell level being casted and the caster must make a concentration check against your monk level as a DC. If it fails the spell counts as you casted it. This reaction cannot be counterspelled.
@abrhm
abrhm / raii_value.cpp
Created March 12, 2018 09:37
RAII value
#include <iostream>
#include <type_traits>
template<typename T, class Deleter>
class raii_value
{
public:
static_assert(std::is_fundamental<T>::value, "raii_value must hold a fundamental type");
@abrhm
abrhm / test.cpp
Created December 22, 2017 10:18
Fun with atomics
#include <atomic>
constexpr uint32_t offset = 10000;
// Called from several thread
void calculate(std::atomic<uint32_t>& number)
{
number *= 2;
// ...... long code
aug. 19, 2015 3:58:42 DU org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SDLMetadataEditor' did not find a matching property.
aug. 19, 2015 3:58:42 DU org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.63
aug. 19, 2015 3:58:42 DU org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 30 2015 08:08:33 UTC
aug. 19, 2015 3:58:42 DU org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.63.0
aug. 19, 2015 3:58:42 DU org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
@abrhm
abrhm / gist:7483784
Created November 15, 2013 12:44
Grammar fix
diff --git a/AUTHORS b/AUTHORS
index 5010f9c..a6aab1a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,3 @@
Anders Ossowicki <and@vmn.dk>
Bjørn Væver Hartfelt <hackerninjakills@gmail.com>
+Gabor Abraham <godgab@gmail.com>
\ No newline at end of file
diff --git a/anna.pl b/anna.pl
@abrhm
abrhm / gist:5748258
Created June 10, 2013 12:04
XFrameOptions debug backtrace
abrhm@abrhm-H61M-S2V-B3:~/webkit/WebKit$ gdb WebKitBuild/Debug/bin/DumpRenderTree core
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
@abrhm
abrhm / gist:5747965
Created June 10, 2013 10:55
fast/repaint/region-painting-in-composited-view.html backtrace
(gdb) run fast/repaint/region-painting-in-composited-view.html
Starting program: /home/abrhm/webkit/WebKit/WebKitBuild/Debug/bin/DumpRenderTree fast/repaint/region-painting-in-composited-view.html
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe4369700 (LWP 32073)]
[New Thread 0x7fffe2ad4700 (LWP 32074)]
[Thread 0x7fffe2ad4700 (LWP 32074) exited]
[New Thread 0x7fffe2ad4700 (LWP 32075)]
[New Thread 0x7fffe1cbe700 (LWP 32076)]
[New Thread 0x7fffe14bd700 (LWP 32077)]
Pont::Pont(double x, double y){
ures = false;
this->x=x;
this->y=y;
}
double mintav(Pont* tomb, int size){
double tav=0;
if (size==1)
return 0;
if (size <= 3){
tav = tomb[0].tav(tomb[1]);
if (size == 3) {