Skip to content

Instantly share code, notes, and snippets.

View timurvafin's full-sized avatar

Timur Vafin timurvafin

View GitHub Profile
@timurvafin
timurvafin / todoist-this-week.sh
Last active June 24, 2024 12:15
Raycast script to switch next-week label with this-week
#!/bin/bash
# Required parameters:
# @raycast.author Timur Vafin
# @raycast.authorURL https://github.com/timurvafin
# @raycast.schemaVersion 1
# @raycast.title Todoist This Week
# @raycast.mode fullOutput
# @raycast.packageName Todoist
# @raycast.description Changes tags from next-week to this-week in Todoist tasks.
# blueprints/automation/timurvafin/tion.yaml
blueprint:
name: Tion Climate Control
description: Controls a Tion climate device based on fan speed, HVAC mode, and temperature sensors.
domain: automation
input:
climate_device:
name: Climate Device
### Zont Termostat ###
rest:
- resource: https://lk.zont-online.ru/api/widget/v2/get_devices
method: POST
authentication: basic
username: !secret zont_username
password: !secret zont_password
# app/assets/javascripts/exclude_options.coffee
class @ExcludeOptions
constructor: (el) ->
$el = $(el)
trigger_id = "#" + $el.data("exclude-options")
@$trigger = $el.find(trigger_id)
@$options = $el.find("input[type=checkbox]").not(trigger_id)
@_bindEvents()
# app/assets/javascripts/toggleable_container.coffee
class @ToggleableContainer
constructor: (el) ->
@$el = $(el)
@$container = $("#" + @$el.data("toggleable"))
@_bindEvents()
_bindEvents: ->
@$el.on "change", @_toogle
class CustomComponent
constructor: (@$el) ->
@dataKey = "custom-key"
@defaults = {}
@options = @_options(@$el)
_bindEvents: ->
@$el.on "click", ...
_options: ($el) ->
@timurvafin
timurvafin / upgrade.md
Last active October 5, 2015 10:41
Upgrade to osx 10.11

Upgrade from 10.10 to 10.11

You will require ~ 1h to setup all things.

Homebrew

brew update

OSX

class ApplicationController < ActionController::Base
include Authentication
include Authorization
protect_from_forgery
responders :flash
decent_configuration do
strategy DecentExposure::StrongParametersStrategy
end
class CollectionPresenter
include Enumerable
delegate :current_page, :total_pages, :limit_value, :entry_name, :total_count,
:offset_value, :last_page?, to: :@collection
cattr_accessor :presenter
self.presenter = ModelPresenter
def initialize(collection)
@timurvafin
timurvafin / Gemfile
Created April 3, 2015 10:15
Ruby base with Standalone Migrations
source "https://rubygems.org"
ruby "2.2.1"
gem "sqlite3"
gem "activerecord"
gem "standalone_migrations"
group :development do
gem "rubocop"