Skip to content

Instantly share code, notes, and snippets.

View edjafarov's full-sized avatar

Eldar Dzhafarov edjafarov

View GitHub Profile
<script src="http://remote.nodester.com/socket.io/socket.io.js"></script>
<script src="http://remote.nodester.com/remote.js"></script>
@edjafarov
edjafarov / twi.html
Created May 16, 2012 12:30
Minimum viable example of streaming twitter feed to browser using node.js and socket.io
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script type="text/javascript">
var socket = io.connect("http://localhost");
socket.on("twit", function(data){
console.log(data);
var div = document.createElement("div");
div.innerHTML = data.text;
document.body.insertBefore(div, document.body.childNodes[0]);
})
</script>
@edjafarov
edjafarov / codestyle.js
Created November 28, 2012 15:12
Nope, javascript don't have any problems with callbacks
function day(me, next){
return me.on("7:00", wakedUp);
function wakedUp(err, mood){
if(err){
return next(err);
}
me.eat(full)
}
@edjafarov
edjafarov / gist:5878075
Last active December 19, 2015 01:48
mve - rivets + watch
rivets.configure({
adapter: {
subscribe: function(obj, keypath, callback) {
watch(obj, keypath, callback)
},
read: function(obj, keypath) {
return obj[keypath]
},
publish: function(obj, keypath, value) {
obj[keypath] = value

Drawing

Эльдар Джафаров

Universal Mind, Principal Architect, Kiev

Сумасшедший node.js хипстер-дев. Страстно влюблен в веб технологии и особенно JavaScript. Бесцельно тратил свое время с 2004 года пока не нырнул с головой в водоворот serverside JavaScript.

Модератор jsGroup facebook page и Frontend UA Skype chat.

@edjafarov
edjafarov / app.js
Created October 25, 2013 19:07
react js on compy example
var CommentBox = React.createClass({
render: function() {
return (
<div class="commentBox">
Hello, world! I am a CommentBox.
</div>
);
}
});
React.renderComponent(
Давай будем дружить!)))
Меня зовут Людмила. Я любознательный студент, который стремится познакомится с яркими и классными ребятами.
За окном нас радует весна, которая быстро и уверенно приняла свои владения. Яркое солнце, теплый воздух...но вот настроение почему-то “не пляшет”.
Думала-думала над тем, как его поднять себе и окружающим, и решила, что мне нужно знакомится с крутыми IT-шниками.
И для этого можно найти множество причин:
1. они свободолюбивые,
2. они живут в свое удовольствие,
3. они очень талантливые,
@edjafarov
edjafarov / gist:495d7675185f18772ec2
Created September 13, 2014 11:53
notification POC
/*
title - The title that must be shown within the notification
options (Optional) - An object that allows to configure the notification. It can have the following properties:
-dir : The direction of the notification; it can be auto, ltr, or rtl
-lang: Specifiy the lang used within the notification. This string must be a valid BCP 47 language tag.
body: A string representing an extra content to display within the notification
tag: An ID for a given notification that allows to retrieve, replace or remove it if necessary
icon: The URL of an image to be used as an icon by the notification
ease: type of easin/out
@edjafarov
edjafarov / index.js
Created October 9, 2014 15:10
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@edjafarov
edjafarov / index.js
Created October 9, 2014 15:11
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")