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 Ember from 'ember'; | |
const { | |
getOwner, | |
setOwner | |
} = Ember; | |
let BaseComponent = Ember.Component.extend({ | |
}); |
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 Page = React.createClass({ | |
getInitialState: function() { | |
return {word: null}; | |
}, | |
componentDidMount: function() { | |
var ws = new WebSocket("ws://url.com/ws"); | |
var self = this; | |
ws.onmessage = function(msg) { | |
self.setState({word: msg}); |
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
Ember.CanvasView = Ember.View.extend({ | |
tagName: 'canvas', | |
attributeBindings: ['width', 'height'], | |
content: null, | |
width: 400, | |
height: 100, | |
clipsCanvasToDrawRect: true, | |
clippingRect: null, | |
redrawScheduled: false, | |
init: function () { |
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
currency_comma = function (str) { | |
str += ''; | |
var arr = str.split('.'), | |
integer = arr[0], | |
fraction = arr.length > 1 ? '.' + arr[1] : ''; | |
var regex = /(\d+)(\d{3})/; | |
while (regex.test(integer)) { | |
integer = integer.replace(regex, '$1' + ',' + '$2'); |
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
require 'net/http' | |
ed2k_url_array = Net::HTTP.get(URI.parse('http://www.yyets.com/php/resource/10733')).scan(/"(ed2k:\/\/.+?)"/) | |
ed2k_url_array.each { |ed2k_url| puts ed2k_url } |