Skip to content

Instantly share code, notes, and snippets.

View antonkartashov's full-sized avatar

Anton Kartashov antonkartashov

  • Orenburg, Russia
View GitHub Profile
{
"users": [{
"name": "Tim Cook",
"role": "CEO",
"ava": "😬"
}, {
"name": "Eddy Cue",
"role": "Internet Services",
"ava": "😄"
}, {
import React, {Component} from 'react'
import './App.css'
class Button extends Component {
static get defaultProps() {
return {color: 'red'}
}
handleClick() {
this.props.onClick()
}
"use strict"
// Variables and Constants
let x = 2
const obj = {
a: 10,
b: 20,
c: 30
}
Function.prototype.define = (prop, desc) ->
Object.defineProperty(this.prototype, prop, desc)
class Name
constructor: ({@first, @last}) ->
@define "full",
get: ->
return "#{@first} #{@last}"
const percent = 0.12;
const startX = getCoordinatesForPercent(0)[0]
const startY = getCoordinatesForPercent(0)[1]
const endX = getCoordinatesForPercent(percent)[0]
const endY = getCoordinatesForPercent(percent)[1]
const largeArcFlag = percent > .5 ? 1 : 0
const pathData = [
`M ${startX} ${startY}`,
@antonkartashov
antonkartashov / app.coffee
Created January 3, 2017 04:04 — forked from jemgold/app.coffee
class-based Framer prototypes
# An example with classes building components.
# This stuff is a little fiddly to get set up,
# but once it's working it's great - you can just
# add new instances of the components, and each
# components holds references to all of its
# children. You can set defaults & states for each
# component separately.
#
# (try clicking on the post author, and then on each
# of the comments on a post)
scroll = new ScrollComponent
size: Screen.size
scrollHorizontal: false
layers = []
for i in [0..10]
layer = new Layer
parent: scroll.content
height: 300, width: 750
red = new Layer
x: 543
width: 207
height: 300
backgroundColor: "rgba(255,102,102,1)"
layer = new Layer
height: 300
image: Utils.randomImage()
backgroundColor: "grey"
red = new Layer
x: 543
width: 207
height: 300
backgroundColor: "rgba(255,102,102,1)"
layer = new Layer
height: 300
image: Utils.randomImage()
backgroundColor: "grey"
handle = (Utils.domLoadJSONSync "https://randomuser.me/api/?gender=female&results=27").results
String.prototype.upperCase = -> @charAt(0).toUpperCase() + @slice(1)
for item, i in handle
avatar = item.picture.medium
first = item.name.first.upperCase()
last = item.name.last.upperCase()
name = "#{first} #{last}"