Skip to content

Instantly share code, notes, and snippets.

View webmasterkai's full-sized avatar
🎯
Focusing

Kai Curry webmasterkai

🎯
Focusing
View GitHub Profile
@webmasterkai
webmasterkai / save-camera-snapshot-notification-on-motion.yaml
Last active March 4, 2024 18:05 — forked from niemyjski/save-camera-snapshot-notification-on-motion.yaml
Home Assistant Blueprint - Save a camera snapshot with archive when motion is detected
blueprint:
name: Save a camera snapshot when motion is detected
description: Save a camera snapshot with archive when motion is detected
domain: automation
source_url: https://gist.github.com/webmasterkai/6011ff64fc1a236b8025181a535dbf87
input:
motion_sensor:
name: Motion sensor
description: The sensor wich triggers the snapshot creation
selector:
diff --git a/twitter_pull.class.inc b/twitter_pull.class.inc
index 623fdc3..670c2d1 100644
--- a/twitter_pull.class.inc
+++ b/twitter_pull.class.inc
@@ -54,7 +54,7 @@ class twitter_puller {
// if the first character is @, then consider the key a username
elseif ($prefix == "@") {
$key = drupal_substr($this->twitkey, 1);
- $url = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name='. urlencode($key) .'&include_rts=true&count='. $num;
+ $url = 'http://dong.cape.io/api/twitter/innovadotmu?tweets=3' . urlencode($key) . '?tweets=' . $num;
@webmasterkai
webmasterkai / img.l
Last active November 3, 2018 08:49 — forked from phpdude/nginx.conf
Mirror remote image files, supports dynamic resizing of images. nginx image_filter remote fetching with a local mirror of original and resized image. Using try_files instead of if statements and proxy_pass with proxy_store for permanent local storage. No cache expiration, that will need to be handled outside of this.
server {
server_name img.l;
root /var/www/cache/store/ns365;
index index.html;
# This requests the original file from itself and then resizes the image.
location ~ /resize/(\d+)x(\d+)/(.*) {
proxy_pass http://img.l/$3;
image_filter resize $1 $2;
image_filter_jpeg_quality 90;