Skip to content

Instantly share code, notes, and snippets.

View teyou's full-sized avatar

Rudy teyou

  • Singapore
View GitHub Profile
@InsaneWookie
InsaneWookie / config_m1s_home_assistant.md
Last active July 9, 2024 01:18
Configure Aqara M1S Gateway for Home Assistant
@rectifyer
rectifyer / tvdb.rb
Last active March 10, 2023 01:15
Get images from TVDB
require 'httparty'
# TVDB
TVDB_API_KEY = '[your api key]'
TVDB_USERNAME = '[your username]'
TVDB_USERKEY = '[your user key]'
image_prefix = 'http://thetvdb.com/banners/'
# get token
response = HTTParty.post('https://api.thetvdb.com/login', {
@rectifyer
rectifyer / tmdb.rb
Created October 11, 2016 17:38
Get images from TMDB
require 'httparty'
# TMDB
TMDB_API_KEY = '[your api key]'
# get configuration parameters
response = HTTParty.get("https://api.themoviedb.org/3/configuration?api_key=#{TMDB_API_KEY}")
config = JSON.parse(response.body)
image_prefix = config['images']['secure_base_url']
@rectifyer
rectifyer / fanarttv.rb
Last active June 24, 2019 02:45
Get Images from Fanart.tv
require 'httparty'
# Fanart.tv
FANART_API_KEY = '[your api key]'
FANART_CLIENT_KEY = '[your client key]'
# --------------------
# movie iamges
tmdb_id = 20526 # Tron: Legacy
import React, { Component, } from 'react'
import {
View,
Image,
Text,
Dimensions,
ScrollView,
} from 'react-native'
const {height, width} = Dimensions.get('window')
@chantastic
chantastic / on-jsx.markdown
Last active May 30, 2024 13:11
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't