Skip to content

Instantly share code, notes, and snippets.

View lorenzschmid's full-sized avatar

Lorenz Schmid lorenzschmid

  • ACP Advanced Circuit Pursuit AG
  • Zurich, Switzerland
View GitHub Profile
@philshem
philshem / meteoswiss_endpoints.md
Last active February 14, 2024 09:51
JSON endpoints for MeteoSwiss real-time measurements

real-time

The measurement data behind this page https://www.meteoswiss.admin.ch/home/measurement-values.html can be found as json format from these endpoints (includes geocoordinates for each measurement station, although seems not a valid geojson). To switch languages, replace en in the URL with de, fr or it.

Air temperature (10 minutes): https://data.geo.admin.ch/ch.meteoschweiz.messwerte-lufttemperatur-10min/ch.meteoschweiz.messwerte-lufttemperatur-10min_en.json

Precipitation (daily total, 10 minutes): https://data.geo.admin.ch/ch.meteoschweiz.messwerte-niederschlag-10min/ch.meteoschweiz.messwerte-niederschlag-10min_en.json

@torarnv
torarnv / revert-windows-acl.sh
Created January 21, 2019 15:09
Disabling Windows ACL for a Synology share
#!/bin/bash
# Run in share directory, e.g. /volume1/foo
echo "Removing share '$1' without removing files..."
sudo synoshare --del FALSE $1
echo "Changing ownership of files..."
sudo chown -R $USER:users . *
@c18s
c18s / docker-compose-acme.yml
Last active April 24, 2019 08:54
acme.sh docker compose
## --- Docker Compose ---
version: '2'
services:
acme.sh:
image: neilpang/acme.sh container_name: acme.sh
restart: always
environment:
- Namecom_Username=
- Namecom_Token=
volumes:
@bl4ck5un
bl4ck5un / responsive-semantic-ui.css
Created May 12, 2017 03:20
Responsive helpers (mobile-only etc.) for semantic-ui
/* Semantic UI has these classes, however they're only applicable to*/
/* grids, containers, rows and columns.*/
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/
/* this snippet is using the same class names and same approach*/
/* plus a bit more but to all elements.*/
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
@mattsches
mattsches / configuration.yaml
Created May 8, 2017 21:35
Beispiel für RESTful Sensor in Home Assistant zur Abfrage des luftdaten.info API
sensor:
- platform: rest
resource: http://api.luftdaten.info/v1/sensor/1777
value_template: >
{% if value_json is sequence %}
{% set sensor = value_json | last %}
{% else %}
{% set sensor = value_json %}
{% endif %}
{% for sdv in sensor.sensordatavalues %}
@idleberg
idleberg / sublime-text-macos-context-menu.md
Last active February 20, 2024 09:37 — forked from vincentmac/sublime-text-osx-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@manigandham
manigandham / rich-text-html-editors.md
Last active March 13, 2024 23:51
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@simeonf
simeonf / pex.md
Last active January 9, 2024 05:11
Creating a PEX from a python script

So you want to create a pex that packages your script and its dependencies?

Ok - first to make our script! Call it foo.py:

import requests

if __name__ == '__main__':
  req = requests.get("https://raw.githubusercontent.com/pantsbuild/pex/master/README.rst")
  print req.text.split("\n")[0]
@julianlam
julianlam / expose-directory-on-host-to-lxc-container.md
Last active April 7, 2024 04:01
Exposing a directory on the host machine to an LXC container #blog

Exposing a directory on the host machine to an LXC container

  1. Log into the container and create an empty directory, this will be the mount point
  2. Log out and stop the container.
  3. Open to your container's config file
    • For regular LXC containers: /var/lib/lxc/mycontainer/config
    • For unprivileged LXC containers: $HOME/.local/share/lxc/mycontainer/config
  4. Add a new line above the lxc.mount directive, that follows the format below. Substitute proper paths as necessary:
    • lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0
  • Both of these paths are relative to the host machine.