Skip to content

Instantly share code, notes, and snippets.

View stritti's full-sized avatar
👨‍🏫

Stephan Strittmatter stritti

👨‍🏫
View GitHub Profile
@jcxplorer
jcxplorer / uuid.js
Created February 12, 2011 16:58
UUID v4 generator in JavaScript (RFC4122 compliant)
function uuid() {
var uuid = "", i, random;
for (i = 0; i < 32; i++) {
random = Math.random() * 16 | 0;
if (i == 8 || i == 12 || i == 16 || i == 20) {
uuid += "-"
}
uuid += (i == 12 ? 4 : (i == 16 ? (random & 3 | 8) : random)).toString(16);
}
@php-coder
php-coder / Email.java
Created January 15, 2012 17:09
Custom @Email annotation which requires top-level domain
package ru.mystamps.web.validation.jsr303;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.ReportAsSingleViolation;
import javax.validation.constraints.Pattern;
@zachbrowne
zachbrowne / auto-post.php
Created August 9, 2012 06:45
Auto post status updates to Google+
<?php
// REQUIRED PARAMETERS
$status = 'http://www.mylink.com';
$email = 'your@email.com';
$pass = 'yourpassw0rd';
@cyclingengineer
cyclingengineer / README
Last active December 31, 2019 10:46
OpenHAB Heating Control Rules
OpenHAB Heating Example
========================
This heating example shows three rooms in my house with 1 radiator valve, 1 temperature sensor per room and a single boiler. It could be adapted for different situations.
The rules allow for simple addition of items in rooms as long as they follow the naming convention and have at least a valve, a thermometer, setpoint and a demand switch.
The demand switch is purely internal and is used to indicate if the room requires heat or not. All rooms are OR'd together to define the boiler status and each room demand (On/Off) is applied to the radiator valves.
It could be more generic for multiple thermometers/valves per room - but it suits my needs for now. If I make it more generic I will update it accordingly.
@brentonstrine
brentonstrine / css-compress.php
Last active December 3, 2019 18:49 — forked from manastungare/css-compress.php
Fix space removal so that it doesn't break space-separated values where the developer used more than one space to separate values.
<?php
/**
* On-the-fly CSS Compression
* Copyright (c) 2009 and onwards, Manas Tungare.
* Creative Commons Attribution, Share-Alike.
*
* In order to minimize the number and size of HTTP requests for CSS content,
* this script combines multiple CSS files into a single file and compresses
* it on-the-fly.
*
@p3t3r67x0
p3t3r67x0 / prefixed-office-properties.md
Last active February 20, 2024 19:15
MS Office prefixed style properties can be used for older versions of MS Excel, MS PowerPoint or MS Word when you want to save a document, presentation, workbook, or worksheet as a web document, or even in older versions for MS Outlook.

MS Office prefixed style properties

mso-ansi-font-size

Note: Office only

mso-ansi-font-size: large | larger | <length> | medium | <percentage> | small | smaller | x-large | x-small | xx-large | xx-small
@onjin
onjin / docker-compose.yml
Created September 5, 2016 09:17
example docker compose for postgresql with db init script
postgres:
image: postgres:9.4
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
#!/bin/bash
#
# Remove Homie Device from MQTT
#
# Simple Script to remove all reatined messages for a homie device, effectively removing the device from MQTT.
# The script get all topics "below" a device e.g homie/a020a615f72c/$mac and
# send a NULL message with mosquitto_pub to the topic. This removes the retained
# message and the topic will not show up anymore.
#
# How?
@sconstantinides
sconstantinides / styles.css
Created April 27, 2018 23:06
PWA media queries
/* Replace "standalone" with "fullscreen" depending on your manifest.json display mode */
@media (display-mode: standalone) {
/* All installed PWAs */
}
@media (max-width: 576px) and (display-mode: standalone) {
/* Installed PWAs on mobile devices */
@supports (-webkit-overflow-scrolling: touch) {
@brenopolanski
brenopolanski / vue-axios-cors.md
Last active August 14, 2023 10:10
Vue.js + Axios + CORS

Proxy requests using Webpack dev server to avoid cors in development mode.

In your webpack.config file add:

"devServer":{
  "proxy": {
    "/api": {
    "target": 'https://my-target.com',
    "pathRewrite": { '^/api': '' },