This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-spec get_timestamp() -> integer(). | |
get_timestamp() -> | |
{Mega, Sec, Micro} = os:timestamp(), | |
(Mega*1000000 + Sec)*1000 + round(Micro/1000). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "agadganov" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "data analysis" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "data analysis" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('body').append('<div id="log" style="position: fixed; color: red; left:0;top:0;right:0; z-index: 100000"></div>'); | |
window.consoleLog = function(text) { | |
$('#log').append('<p>' + text + '</p>'); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var s = http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.write('Hello\n'); | |
setTimeout(function() { | |
res.end(' World\n'); | |
}, 5000); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$default-font-size = 16px | |
mobile() | |
@media (max-width: 800px) | |
{block} | |
small-mobile() | |
@media (max-width: 450px) | |
{block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function retargetEvents(el) { | |
// Here include necessary events' name to track | |
['onClick', 'onChange'].forEach(eventType => { | |
const transformedEventType = eventType.replace(/^on/, '').toLowerCase(); | |
el.addEventListener(transformedEventType, event => { | |
for (let i in event.path) { | |
const item = event.path[i], | |
internalComponent = findReactInternal(item); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRandomArrayElements(arr, count) { | |
var sliceStart = getRandomInt(0, arr.length - count), | |
randomSlice = arr.slice(sliceStart, sliceStart + count); | |
return shuffleArray(randomSlice); | |
} | |
/** | |
* Returns a random integer between min (inclusive) and max (inclusive) | |
* Using Math.round() will give you a non-uniform distribution! | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, PropTypes} from 'react'; | |
import ReactInfinite from 'react-infinite'; | |
// @copy-paste https://github.com/Radivarig/react-infinite-any-height | |
// refactored and optimized | |
/** | |
* How it works: long story short it adds elements' height on rendering in react-infinite | |
*/ | |
class InfiniteAnyHeight extends Component { |
OlderNewer