This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); | |
header("Cache-Control: post-check=0, pre-check=0", false); | |
header("Pragma: no-cache"); | |
//Your timezone | |
date_default_timezone_set("Europe/Amsterdam") ; | |
//IP Address of Homey, make sure it has a fixed address | |
$homey_ip = "192.168.1.6" ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// (c) Tom Van Looy <tom@ctors.net> https://ctors.net/isc_license.txt | |
// Alle feestdagen kunnen berekend worden, de berekende zijn allemaal | |
// afhankelijk van pasen. PHP heeft een functie easter_date(). | |
// Makkie dus. Hoe easter_date() zelf werkt kan je hier raadplegen: | |
// https://github.com/php/php-src/blob/master/ext/calendar/easter.c | |
// Geen parameter? Doen we gewoon dit jaar toch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
// https://twitter.com/#!/marcoarment/status/59089853433921537 | |
date_default_timezone_set('America/Los_Angeles'); | |
// Sosumi - a PHP client for Apple's Find My iPhone web service | |
// | |
// June 20, 2010 | |
// Tyler Hall <tylerhall@gmail.com> | |
// http://github.com/tylerhall/sosumi/tree/master | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# putiodl - put.io cli downloader | |
# | |
# Copyright (C) 2013 Neal <neal@ineal.me> | |
# | |
# Dependencies: jq, curl, wget | |
# | |
# Make sure ~/.putiodl exists and contains your put.io OAuth token. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# putiodl - put.io cli downloader | |
# | |
# Copyright (C) 2013 Neal <neal@ineal.me> | |
# | |
# Dependencies: jq, curl, wget | |
# | |
# Make sure ~/.putiodl exists and contains your put.io OAuth token. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//set the mm of rain you consider it's raining | |
$rainthreshold_minutes = "0.1" ; | |
$rainthreshold_hours = "0.5" ; | |
// according to buienradar there are 5 levels of rain per hour (mm/h) | |
// 0-2 | |
// 2-5 | |
// 5-10 | |
// 10-100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('max_execution_time', 0); | |
ini_set('memory_limit', -1); | |
$host = 'google.com'; | |
$ports = array(21, 25, 80, 81, 110, 143, 443, 587, 2525, 3306); | |
foreach ($ports as $port) | |
{ | |
$connection = @fsockopen($host, $port, $errno, $errstr, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//since this is mainly geared toward the dutchies the return values are in dutch, | |
//you can however just update these to your own language | |
// make sure you cover the two below AND the ones in the "nice" function | |
$txt_today = "vandaag" ; | |
$txt_tomorrow = "morgen" ; | |
function nice($input){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); | |
header("Cache-Control: post-check=0, pre-check=0", false); | |
header("Pragma: no-cache"); | |
$dir = 'logs'; | |
date_default_timezone_set("Europe/Amsterdam"); | |
//here you set the time format the current setup will show YYYYMMDD HH:MM:SS | |
//please see the php date() documentation to change | |
$current_time = date('Ymd H:i:s' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set HUB to "192.168.1.216" --change for your bridge IP | |
set USER to "newdeveloper" | |
repeat | |
repeat with bulb from 1 to 2 -- Change if you have more bulbs or want to use a subset | |
set hue to (random number from 5000 to 12750) | |
set sat to (random number from 150 to 255) | |
set bri to (random number from 50 to 255) | |
set transitiontime to (random number from 1 to 3) -- Increase range for slower transitions | |
set query to "{\"sat\":" & sat & ",\"hue\":" & hue & ",\"bri\":" & bri & ",\"transitiontime\":" & transitiontime & "}" | |
set command to "curl --request PUT --data '" & query & "' http://" & HUB & "/api/" & USER & "/lights/" & bulb & "/state/ --connect-timeout 5" |