Skip to content

Instantly share code, notes, and snippets.

View sejoker's full-sized avatar

Yevgen Safronov sejoker

  • Cloudflare
  • London, UK
View GitHub Profile
import { render } from 'react-dom';
import { Button, ButtonGroup } from 'cf-component-button';
import { StyleProvider } from 'cf-style-provider';
const ButtonComponent = () => (
<ButtonGroup>
<Button type="primary" onClick={() => console.log('Clicked One!')}>
Button One
</Button>
aaa
@sejoker
sejoker / app.js
Created May 11, 2015 23:05
Egg timer with Pebble.js
var UI = require('ui');
var Vector2 = require('vector2');
var Vibe = require('ui/vibe');
var menu = new UI.Menu({
sections: [{
title: 'Egg size',
items: [{
title: 'Medium',
}, {
/**
* React (with addons) v0.14.0-beta2
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license fou
var fs = require('fs')

function(cb){
		fs.readFile(process.argv[2], function(err, data){
			if (err){
				cb(err);
			} else {
				cb(null, data.toString())
 }
  1. npm install request в локальной папке с решениями
  2. сохраните следующий код в отдельном файле get.js:
var request = require('request');

module.exports = function (url, cb){
  request(url, function(error, response, body){
    if (error){
      cb(error);
 } else {
@sejoker
sejoker / StandardFirmataForATH0.ino
Last active August 29, 2015 14:09 — forked from edgarsilva/StandardFirmataForATH0.ino
Modified firmata protocol that works on the arduino YUN linux side communicating to the arduino side using the ttyATH0 serialport interface. With Pulse_In support
/*
* Firmata is a generic protocol for communicating with microcontrollers
* from software on a host computer. It is intended to work with
* any host computer software package.
*
* To download a host software package, please clink on the following link
* to open the download page in your default browser.
*
* http://firmata.org/wiki/Download
*/
@sejoker
sejoker / gist:033ae4781d4b95413e56
Created November 14, 2014 10:37
JS Fundamentals homework 2
Задача
Пройти воркшоп http://nodeschool.io/#functionaljavascript
Шаги по установки описаны здесь: https://www.npmjs.org/package/functional-javascript-workshop
Успешно выполненные задания сохраняйте отдельными .js файлами в вашем git репозитории.
@sejoker
sejoker / gist:97bd9b4257412d9fc81f
Last active August 29, 2015 14:09
JS Fundamentals homework 1
Задача №0.
Настроить JSHint для своего IDE
описание: http://www.jshint.com/install/
Задача №1.
Реализация функции deepCopy - для копирования объекта с учетом вложенных объектов:
var a = {b: ‘c’, d: {e: ‘f’}},
b = deepCopy(a);
a.d = 12;
b.d // {e: ‘f’}