Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View raphaeleidus's full-sized avatar

Raphael Eidus raphaeleidus

View GitHub Profile
@raphaeleidus
raphaeleidus / wake-up-light-alarm-with-sunrise-effect.yaml
Last active November 29, 2022 03:27 — forked from sbyx/wake-up-light-alarm-with-sunrise-effect.yaml
Home Assistant Blueprint: Wake-up light alarm with sunrise effect - Manual runnable
blueprint:
name: Wake-up light alarm with sunrise effect - Manual runnable
description: 'A wake-up light alarm with a brightness and color temperature sunrise
effect. Note: Requires date_time_iso sensor in configuration, not manually executable!'
domain: automation
input:
light_entity:
name: Wake-up light entity
description: The light to control. Turning it off during the sunrise will keep
it off. Color temperature range is auto-detected.
@raphaeleidus
raphaeleidus / index.html
Last active August 29, 2015 14:07
video with gif fallback test
<video loop autoplay>
<source src='video.mp4' type='video/mp4' />
<source src='video.ogv' type='video/ogg' />
<img src='http://38.media.tumblr.com/3949f95214c1798f96eef27ccf878b15/tumblr_naqv4tFDqG1s2yegdo1_400.gif' />
</video>
@raphaeleidus
raphaeleidus / gist:3452495
Created August 24, 2012 16:22
Object-Oriented JS and Private Messaging

Use GistDeck to View

Why is this important?

  • OO Code is maintainable
  • loosely or unstructured JS code begets more unstructured code
  • Preventing from contact-list.js from ever happening again
  • Maintainability
@raphaeleidus
raphaeleidus / gist:3210017
Created July 30, 2012 20:44
ERMAHGERD ERLL THER THERNGS
javascript:(function(){
$('*').contents().each(function(index){
if (this.nodeType !== 3) {
return;
}
var text = $(this).text();
text = text.toUpperCase();
text = text.replace(/[AEIOUY]r(?! )/g, 'E');
text = text.replace(/AA/g, 'A');
text = text.replace(/EE/g, 'E');
@raphaeleidus
raphaeleidus / gist:3183466
Created July 26, 2012 17:51
Using Event Listeners to create observer pattern
// Custom Events Used:
// { type: "privateMessages_newConversation", messages: {}, partner: {} }
// { type: "privateMessages_newMessage", message: {} }
// { type: "privateMessages_conversationListLoaded", payload: {} }
var PrivateConversation = function(event_id, recipient_hash, url) {
this.partner = recipient_hash;
this.event_id = event_id;
this.messager_id = recipient_hash.messager_id;
this.messager_type = recipient_hash.messager_type;