Large String - 3,665 ops/sec
Small String - 1,162,858 ops/sec
window.atob(base64EncodedString)
| // somewhere else in time and space | |
| SomeView = new Backbone.Marionette.View.extend({ | |
| onDestroy: function(){ | |
| App.vent.trigger('define:var:to:block:callback'); | |
| } | |
| }); | |
| // some other view |
| React = require "react/addons" | |
| { | |
| TestUtils | |
| } = React.addons | |
| Users = require "../Users.coffee" | |
| stubRouterContext = require "utils/stubRouterContext" |
| _ = require "underscore" | |
| ### | |
| Drop this mixin into a component that wastes time according to Perf.getWastedTime() to find | |
| out what state/props should be preserved. Once it says "Update avoidable!" for {state, props}, | |
| you should be able to drop in React.addons.PureRenderMixin | |
| React.createClass | |
| mixins: [WhyDidYouUpdateMixin] | |
| ### |
| arePermutations = (str1, str2) -> | |
| return false unless str1.length is str2.length | |
| occurrences = {} | |
| for i in [0...str1.length] | |
| char = str1.charAt(i) | |
| occurrences[char] = (occurrences[char] or 0) + 1 | |
| for i in [0...str2.length] |
| #!/bin/bash | |
| # enable writing to NTFS drives | |
| function mount { | |
| diskutil list | |
| echo “please enter the ntfs disk to be mounted:” | |
| read inp | |
| #### http://mywiki.wooledge.org/BashFAQ/031#np2 | |
| if [[ $inp =~ ^.*(disk0).*$ || $inp =~ ^.*(disk1).*$ ]]; then | |
| echo dangerous input! |
| ########## | |
| # Win10 Initial Setup Script | |
| # Author: Disassembler <disassembler@dasm.cz> | |
| # Version: 1.7, 2016-08-15 | |
| # dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/ | |
| # THIS IS A PERSONALIZED VERSION | |
| # This script leaves more MS defaults on, including MS security features. | |
| # Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1 |
| #!/usr/bin/env node | |
| const http = require('http') | |
| const fs = require('fs') | |
| const url = 'http://pokeapi.co/api/v2/pokemon-species/' | |
| let results = [] | |
| const receivedAllResults = () => { | |
| const filename = './names.json' |
| { | |
| "names": [ | |
| "bulbasaur", | |
| "ivysaur", | |
| "venusaur", | |
| "venusaur", | |
| "charmander", | |
| "charmeleon", | |
| "charizard", | |
| "charizard", |
| import ReactDOM from 'react-dom/server' | |
| import React from 'react' | |
| import Typography from '../../src/' | |
| import GoogleFont from '../../src/components/GoogleFont' | |
| import theme from '../../src/themes/us-web-design-standard' | |
| const typography = new Typography(theme) | |
| // Hot reload typography in development. |