Skip to content

Instantly share code, notes, and snippets.

Avatar

Neil Kimmett neilkimmett

View GitHub Profile
View gist:f5d3d860a667cead97c13140c89ebb61
{
"plus_code" : {
"compound_code" : "G3JQ+2X Pudahuel, Chile",
"global_code" : "47RFG3JQ+2X"
},
"results" : [
{
"address_components" : [
{
"long_name" : "Mina Cuesta Lo Aguirre",
View requirements.txt
google-api-python-client
google-auth-httplib2
google-auth-oauthlib
python-dotenv
boto3
View Class.swift
class Class {
let id: Int
init(id: Int) {
self.id = id
}
}
class Schedule {
let `class`: Class
View gist:816dc4b6aa8bfd413906b1263ac3a216
"images": {
"mobile": {
"1x": "https://res.cloudinary.com/classpass/image/upload/f_auto,q_auto,w_320,c_scale,h_160/hh45owvba8qofnxmwwiq.png",
"2x": "https://res.cloudinary.com/classpass/image/upload/f_auto,q_auto,w_640,c_scale,h_320/hh45owvba8qofnxmwwiq.png",
"3x": "https://res.cloudinary.com/classpass/image/upload/f_auto,q_auto/hh45owvba8qofnxmwwiq.png",
"v1x": "https://res.cloudinary.com/classpass/image/upload/f_auto,q_auto,w_320,c_scale,h_350/zhj0yaeweembxdje2u40.png",
"v2x": "https://res.cloudinary.com/classpass/image/upload/f_auto,q_auto,w_640,c_scale,h_700/zhj0yaeweembxdje2u40.png",
"v3x": "https://res.cloudinary.com/classpass/image/upload/f_auto,q_auto/zhj0yaeweembxdje2u40.png"
},
"default": "https://res.cloudinary.com/classpass/image/upload/f_auto,q_auto/l1smmwfrhf1glaa5rycd.png"
View colors.yml
global:
type: color
category: color
props:
colorTeal:
value: "#23cfb9"
deprecated: "Deprecated, use colorBrand"
colorBrand:
value: "#0055ff"
View setup.js
const colors = result
.get('props')
.map(prop => {
const { r, g, b, a } = tinycolor(prop.get('value')).toRgb();;
return ` @objc static let ${prop.get('name')} = #colorLiteral(red: ${parseFloat(r)/255.0}, green: ${parseFloat(g)/255.0}, blue: ${parseFloat(b)/255.0}, alpha: ${parseFloat(a)})`;
});
View setup.js
const colors = result.get('props').map(prop => prop.get('value'))
View setup.js
module.exports = theo => {
theo.registerFormat('ios.color.swift', result => {
const colors = []
return [
'import UIKit',
'',
'extension UIColor {',
...colors,
'}'
].join('\n');
View package.json
"ios": "theo color.yml - setup setup.js - format ios.color.swift > UIColor+Token.swift"
View setup.js
module.exports = theo => {
theo.registerFormat('ios.color.swift', result => {
return `🎉`;
});
}