Skip to content

Instantly share code, notes, and snippets.


Yevgen Safronov sejoker

  • Cloudflare
  • London, UK
View GitHub Profile
View button-example.js
import { render } from 'react-dom';
import { Button, ButtonGroup } from 'cf-component-button';
import { StyleProvider } from 'cf-style-provider';
const ButtonComponent = () => (
<Button type="primary" onClick={() => console.log('Clicked One!')}>
Button One
sejoker / app.js
Created May 11, 2015 23:05
Egg timer with Pebble.js
View app.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',
}, {
View react-with-addons.js
* 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
View gist:bf350d2a2ef64aa8a0e8
var fs = require('fs')

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

module.exports = function (url, cb){
  request(url, function(error, response, body){
    if (error){
 } else {
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
View StandardFirmataForATH0.ino
* 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.
sejoker / gist:033ae4781d4b95413e56
Created November 14, 2014 10:37
JS Fundamentals homework 2
View gist:033ae4781d4b95413e56
Пройти воркшоп
Шаги по установки описаны здесь:
Успешно выполненные задания сохраняйте отдельными .js файлами в вашем git репозитории.
sejoker / gist:97bd9b4257412d9fc81f
Last active August 29, 2015 14:09
JS Fundamentals homework 1
View gist:97bd9b4257412d9fc81f
Задача №0.
Настроить JSHint для своего IDE
Задача №1.
Реализация функции deepCopy - для копирования объекта с учетом вложенных объектов:
var a = {b: ‘c’, d: {e: ‘f’}},
b = deepCopy(a);
a.d = 12;
b.d // {e: ‘f’}