Skip to content

Instantly share code, notes, and snippets.

View outlying's full-sized avatar

Iwo Polański outlying

View GitHub Profile
@outlying
outlying / Watering.ino
Created February 12, 2020 21:12
Arduino watering
int relayPin = 2;
int moisturePin = A0;
void setup() {
Serial.begin(9600);
Serial.println("Setup, wait");
// Relay management
pinMode(relayPin, OUTPUT);
@outlying
outlying / compliments.json
Last active January 11, 2020 21:15
Compliments for mirror
{
"anytime" : [
"Hej sexi"
],
"morning" : [
"Dzień dobry"
],
"evening" : [
"Dobry wieczór"
],
@outlying
outlying / airly.py
Created October 30, 2018 19:04
Home Assistant Airly sensor - air quality platform
from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.entity import Entity
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the sensor platform."""
add_devices([ExampleSensor()])
class ExampleSensor(Entity):
@outlying
outlying / StringConverter.java
Created May 12, 2015 09:10
StringConverter for Retrofit, allows to receive responses as String, Android friendly solution
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.Scanner;
import retrofit.converter.ConversionException;
import retrofit.converter.Converter;
import retrofit.mime.TypedInput;
import retrofit.mime.TypedOutput;
import retrofit.mime.TypedString;
@outlying
outlying / toolbar-hide-show
Created February 20, 2015 07:40
Simple snippet for toolbar show/hide animation, remember, you have to add separate Toolbar view to your layout
@Override
public void showToolbar() {
toolbar.animate()
.setInterpolator( new AccelerateInterpolator() )
.translationY( 0 )
.start();
}
@outlying
outlying / android_sdk_update.sh
Created January 20, 2015 10:36
Android SDK update on headless server (Unix)
#!/bin/bash
expect -c '
set timeout -1;
spawn android - update sdk --no-ui;
expect {
"Do you accept the license" { exp_send "y\r" ; exp_continue }
eof
}
'
@outlying
outlying / move_tv_show.php
Created January 26, 2014 14:41
This script search target directory for video files, and move them to corresponding subdirectories in target directory. Script was made for moving downloaded tv shows files from one place to another. Best work with XBMC library.
#!/usr/bin/php5
<?php
$options = getopt("s:t:");
if( !array_key_exists("s", $options)){
throw new Exception('Missing source directory option -s /source/path');
}
if( !array_key_exists("t", $options)){
@outlying
outlying / tvshows.php
Created March 30, 2013 18:36
Sidereel to Transmission torrent adding
#!/usr/bin/php -q
<?php
/**
* Collect required arguments
**/
if( count( $argv ) != 5 ){
die( "\nMissing arguments\n\ntvshows <sidereel_user> <sidereel_password> <transmission_user> <transmission_password>\n\n" );
}
@outlying
outlying / subtitles
Last active December 14, 2015 04:29
This scrip will search for media movie files then it will try to get valid subtitles ( if available ) for them, it uses qnapi ( NapiProjekt ) - polish subtitle database but you can easily use any other system for that
#!/bin/bash
SEARCH_DIR=$1
if [ -z "$SEARCH_DIR" ]; then
echo "Missing first argument, provide path"
exit
fi