Skip to content

Instantly share code, notes, and snippets.

View andrejpavlovic's full-sized avatar

Andrej Pavlovic andrejpavlovic

View GitHub Profile
@nandorojo
nandorojo / eas-update-sentry.ts
Last active May 31, 2024 02:49
EAS Update + Sentry Source Maps
import { getConfig } from '@expo/config'
import fs from 'fs'
import spawnAsync from '@expo/spawn-async'
import chalk from 'chalk'
import path from 'path'
const appDir = process.cwd()
console.log()
console.log(chalk.green('Sentry source maps script. Working directory:'))
@nebhead
nebhead / DG6HD-1BW.txt
Last active September 18, 2023 12:40
Programming the Leviton DG6HD-1BW ZigBee Dimmer Switch with ZigBee2MQTT
Programming the Leviton DG6HD-1BW ZigBee Dimmer Switch with ZigBee2MQTT
While the dimmer swith has options to program the minimum, maximum dimmer values through the paddle switch, other options such as the default light level, transition times, etc. are only available to be programmed via the ZigBee coordinator (per Leviton support).
For ZigBee2MQTT (Z2M):
Go to the device from the devices page. On the Dev Console tab for the device you can select what endpoints and clusters you want to read\write to. To read current values from the below and/or write the values to modify the behavior of the lights.
Endpoint 1 Cluster LevelCtl will have the following programmable attributes:
- onLevel: Brightness level the light will be set to by default when turned on. [Set to 254 to enable full brightness, set to 255 to enable previous level]
@giautm
giautm / branch.plugin.js
Last active October 4, 2023 14:01
Expo plugin to config react-native-branch
const {
AndroidConfig,
WarningAggregator,
withAndroidManifest,
withAppDelegate,
withDangerousMod,
withInfoPlist,
withMainActivity,
withPlugins,
} = require('@expo/config-plugins')
@plembo
plembo / upnper4dont.md
Last active July 23, 2024 04:11
UPnP with EdgeRouter: Don't do it! Ubiquiti. ER-4.

Want to configure UPnP on EdgeRouter-4?

Don't do it!

Introduction

As a former sysadmin that once helped ride herd over around 1,000 servers, of which around 10% were Internet-facing, I've never been a fan of autoconfiguation when it comes to punching holes through the firewall. I've seen the tripwire logs, and it's sobering.

The Problem

So enabling UPnP on my EdgeRouter-4 wasn't something I had on the roadmap, but when I ran into difficulty getting DLNA to work on the default VLAN, I thought it was worth looking into (never mind that, as I later learned, having UPnP turned on wasn't going make a bit of difference on my local network: another reason that mastering theory should always come before practice).

@xezpeleta
xezpeleta / edgerouter_dns.md
Created January 22, 2019 12:11
Dynamic DNS on the Ubiquiti EdgeRouter X

Ubiquiti EdgeRouter X: custom dynamic DNS

ssh ubnt@<your-ip>
configure

Obtain your public IP address behind a NAT: using ipinfo.io

@joepie91
joepie91 / vpn.md
Last active July 24, 2024 06:18
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@CptLemming
CptLemming / UNDO_README.md
Last active September 18, 2020 16:17
Undo command pattern in Redux

Undo command pattern in Redux

This is my attempt at at implementing undo (no redo for now) in Redux.

Middleware is used to implement a command pattern approach to undo / redo, where incoming actions are identified as Commands and added to a stack.

When the undo() action is raised the middleware halts the current action instead calling the undo method of the previous Command.

Pitfalls

  • Due to implementing via middleware, only one stack may exist for the entire application.
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active July 4, 2024 07:31
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.