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 math | |
pokemon = { | |
"bulbasaur":{"stamina":90,"attack":118,"defense":118}, | |
"ivysaur":{"stamina":120,"attack":151,"defense":151}, | |
"venusaur":{"stamina":160,"attack":198,"defense":198}, | |
"charmander":{"stamina":78,"attack":116,"defense":96}, | |
"charmeleon":{"stamina":116,"attack":158,"defense":129}, | |
"charizard":{"stamina":156,"attack":223,"defense":176}, | |
"squirtle":{"stamina":88,"attack":94,"defense":122}, |
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
[ | |
{ | |
"id": 1, | |
"name": "BULBASAUR", | |
"type1": "GRASS", | |
"type2": "POISON", | |
"stats": { | |
"stamina": 90, | |
"attack": 118, | |
"defense": 118 |
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
const Benchmark = require('benchmark'); | |
const React = require('react/dist/react.min'); | |
const ReactDOMServer = require('react-dom/dist/react-dom-server.min'); | |
const suite = new Benchmark.Suite(); | |
// ========================================================================== | |
// LotsOfBytes test: | |
// > A metric shit ton of markup output by a single React element. |
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 Matchup(props) { | |
const matchups = props.name ? idealMatchup.overall(props.name) : [] | |
return ( | |
$(B.View, [ | |
$(B.Header, 'Ideal Matchup'), | |
$(B.Text, 'This is calculated based on the opposing Pokemon\'s type and assuming the opponent has the best possible moveset combination for their Pokemon. The results do not include legendaries. Pokemon type effectiveness and resistances are also taken into account.'), | |
$('hr'), | |
$(FormPokemonName, { name: props.name }), | |
matchups.length ? ( | |
$(B.Table, { |
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 Alt from 'alt' | |
const alt = new Alt() | |
const CounterActions = alt.createActions({ | |
inc: x => x, | |
dec: x => x, | |
}); | |
const CounterStore = alt.createStore({ |
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
[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]](([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(![]+[])[!+[]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![] |
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 React = require('react') | |
var foo = React.createClass({ | |
render: function () { | |
return React.createElement('select', null, [ | |
React.createElement('option', { | |
key: 1, | |
value: 1, | |
dangerouslySetInnerHTML: { __html: '<strong>yes</strong>' }, | |
}), |
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 jshint = require('jshint').JSHINT | |
var code = 'var hello; ' | |
var fixmyjs = require('./fixmyjs') | |
jshint(code, { trailing: true }) | |
console.log(JSON.stringify(fixmyjs(jshint.data(), code).run())) // = "var hello;" |
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 () { | |
var fact; | |
fact = function (n, sum) { | |
while (true) { | |
switch (false) { | |
case !(arguments.length === 1): | |
return fact(n, 1); | |
case !(n === 0 && arguments.length === 2): | |
return sum; | |
default: |
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 underscore = require('underscore'); | |
var _uniqueId = 0; | |
function _(coll) { | |
this._ = coll; | |
} | |
_.extend = function(obj) { | |
var args = [].slice.call(arguments, 1); | |
args.forEach(function(arg) { |