Skip to content

Instantly share code, notes, and snippets.

@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 10:33
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
import requests
from requests.auth import HTTPBasicAuth
import re
from StringIO import StringIO
JIRA_URL = 'https://your-jira-url.tld/'
JIRA_ACCOUNT = ('jira-username', 'jira-password')
# the JIRA project ID (short)
JIRA_PROJECT = 'PRO'
GITLAB_URL = 'http://your-gitlab-url.tld/'
@secretrob
secretrob / gitlab_to_jira.py
Last active March 28, 2024 10:33 — forked from mvisonneau/gitlab_to_jira.py
GitLab to Jira issue sync
#!/usr/bin/env python
import requests
import gitlab
from jira import JIRA
import urllib3
import json
## Disable urllib3 ssl checks warnings
urllib3.disable_warnings( urllib3.exceptions.InsecureRequestWarning )
@archi
archi / README.md
Last active March 28, 2024 10:32
MBMD+Home Assistant SDM630 Configuration

This is my config for using an SDM630 via MBMD with Home Assistant.

I did some slight adjustments for the general public, but you probably need to adjust some more things:

  1. Setup a proper MQTT user+pass and configure that in mbmd.yaml
  2. Adjust the serial device name. I recommend the by-id variant over /dev/ttyUSBx, especially if you have multiple devices (for me it's the RS485 interface and the Zigbee controller)
  3. Maybe adjust the serial device config (baudrate and comset)
  4. My mbmd is reachable via mbmd.server.lan, you probably want to adjust that in the sdm630.yaml

What I recommend:

Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@danielgalasko
danielgalasko / RepeatingTimer.swift
Last active March 28, 2024 10:26
A repeating GCD timer that can run on a background queue
/// RepeatingTimer mimics the API of DispatchSourceTimer but in a way that prevents
/// crashes that occur from calling resume multiple times on a timer that is
/// already resumed (noted by https://github.com/SiftScience/sift-ios/issues/52
class RepeatingTimer {
let timeInterval: TimeInterval
init(timeInterval: TimeInterval) {
self.timeInterval = timeInterval
}