Skip to content

Instantly share code, notes, and snippets.

@mansouryaacoubi
mansouryaacoubi / Readme.md
Last active March 25, 2024 03:12
Duck DNS DNS Settings

Guide How To use custom domain with Duck DNS: home-assistant/addons#1331 (comment)

Let us imagine the following:

You have a domain example.duckdns.org and you have the domain example.com and want to access your home assistant via home.example.com.

Short Guide

  1. Set CNAME records for your domain: *.home and home pointing to example.duckdns.org
  2. Install or Reinstall the DuckDNS Addon on your home assistant instance.
  3. Set your addon config and leave out your alias for this step
@lysender
lysender / export-import-gpg-keys.md
Created July 1, 2020 03:35
Export and import GPG Keys

Export public key

gpg --export your_address@example.net > my_key.pub 

The file can then be shared to other people.

Export public key in armor ascii format

@moshewe
moshewe / nest-gen-app-swagger.ts
Last active April 24, 2023 10:52
This script generates the swagger spec for a given NestJS Module. It takes the app's path, version and module name as parameters, with optionals for
import * as fs from 'fs';
import { NestFactory } from '@nestjs/core';
import { DocumentBuilder, SwaggerDocument, SwaggerModule } from '@nestjs/swagger';
import * as commander from 'commander';
const program = new commander.Command();
program
.name('single-app-swagger-json-generator')
.arguments('--app-path <app-path> --app-version <app-version>')
.requiredOption('-a, --app-path <path>', 'path to app\'s folder')
@sixertoy
sixertoy / audio-proxy-server.js
Last active October 16, 2023 21:16
Simple Audio Streaming Proxy | NodeJS + Express + MP3
/**
* INSTALL:
* ----
* > yarn add express request
*
* RUN:
* ----
* > node ./audio-proxy-server
*/
const os = require('os');
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 9, 2024 22:33
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@001101
001101 / accounting.sql
Created February 18, 2017 09:08 — forked from NYKevin/accounting.sql
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...
@hamstu
hamstu / parallax.js
Last active February 7, 2024 15:20
Parallax Example: JavaScript
var ParallaxManager, ParallaxPart;
ParallaxPart = (function() {
function ParallaxPart(el) {
this.el = el;
this.speed = parseFloat(this.el.getAttribute('data-parallax-speed'));
this.maxScroll = parseInt(this.el.getAttribute('data-max-scroll'));
}
ParallaxPart.prototype.update = function(scrollY) {
@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing
@BobNisco
BobNisco / controller.js
Last active February 27, 2023 15:43
onLongPress AngularJS Directive - Great for mobile!
// Somewhere in your controllers for this given example
// Example functions
$scope.itemOnLongPress = function(id) {
console.log('Long press');
}
$scope.itemOnTouchEnd = function(id) {
console.log('Touch end');
}
@jonathandixon
jonathandixon / .gitignore
Last active January 5, 2021 22:01
Cordova CLI project .gitignore and helper script. Useful when you don't want to commit the platforms and plugins directories to version control. http://stackoverflow.com/q/17911204/417568
platforms/
plugins/