This file contains hidden or 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
| ready "codepoints" do | |
| before do | |
| @str = "a" * 30 + "x" | |
| end | |
| go "index many matches" do | |
| index = @str.index("a") | |
| while index | |
| index = @str.index("a", index + 1) | |
| end |
This file contains hidden or 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
| gulp = require('gulp') | |
| browserSync = require('browser-sync') | |
| gulp.task 'browser-sync', ['webpack:dev-server'], -> | |
| browserSync( | |
| proxy: "localhost:8081" | |
| port: 8080 | |
| ) | |
This file contains hidden or 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
| class Foo < SimpleDelegator | |
| def in(&block) | |
| instance_eval &block | |
| end | |
| def have_awesomeness | |
| matcher do |target| | |
| expect(target).to eq 3 | |
| end | |
| end |
This file contains hidden or 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 'socket' | |
| require 'benchmark' | |
| puts Benchmark.measure { Socket::gethostbyname(Socket::gethostname) } | |
| # 0.000000 0.000000 0.000000 ( 5.004441) | |
| # fix, in /etc/hosts: 127.0.0.1 localhost my-host.local | |
| # OR: enable IPv6 |
This file contains hidden or 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 neocomplete#handler#_on_write_post() | |
| Called 1 time | |
| Total time: 0.000068 | |
| Self time: 0.000068 | |
| count total (s) self (s) | |
| " Restore foldinfo. | |
| 1 0.000040 for winnr in filter(range(1, winnr('$')), "!empty(getwinvar(v:val, 'neocomplete_foldinfo'))") | |
| let neocomplete_foldinfo = getwinvar(winnr, 'neocomplete_foldinfo') | |
| call setwinvar(winnr, '&foldmethod', neocomplete_foldinfo.foldmethod) |
This file contains hidden or 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
| EditorState = require './editor-state' | |
| describe "", -> | |
| [editor, editorView] = [] | |
| beforeEach -> | |
| waitsForPromise -> atom.workspace.open() | |
| runs -> | |
| editor = atom.workspace.getActiveTextEditor() | |
| editorView = atom.views.getView(editor) |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| PATH = File.expand_path('../..', __FILE__) | |
| PACKAGES_TXT = File.join(PATH, "packages.txt") | |
| def package_list | |
| "apm list --installed --bare --dev false" | |
| end | |
| def main |
This file contains hidden or 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 doMoneyMaking(dispatch) { | |
| return apiCall() | |
| .then(() => { | |
| dispatch({ type: MAKE_MONEY_SUCCESS }); | |
| }) | |
| } | |
| const actions = { | |
| makeMoney() { | |
| return doMoneyMaking; |
This file contains hidden or 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 React = require('react'); | |
| const mapValues = require('lodash/object/mapValues'); | |
| const createGetState = require('app/redux_shims/create_get_state'); | |
| const Fluxxor = require('fluxxor'); | |
| const FluxMixin = Fluxxor.FluxMixin(React); | |
| const StoreWatchMixin = Fluxxor.StoreWatchMixin; | |
| const createDispatcher = require('app/redux_shims/create_dispatcher'); | |
| const Router = require('react-router'); | |
| function bindActionCreator(flux, router, action) { |
This file contains hidden or 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 { createStore, combineReducers, applyMiddleware, compose } = require('redux'); | |
| const reducers = require('app/reducers'); | |
| const thunkMiddleware = require('redux-thunk'); | |
| const simpleDispatchThunkMiddleware = require('app/redux/simple_dispatch_thunk_middleware'); | |
| const { batchedUpdates } = require('redux-batched-updates'); | |
| const simpleDispatch = require('app/redux/simple_dispatch'); | |
| const finalCreateStore = compose( | |
| applyMiddleware(thunkMiddleware), | |
| simpleDispatch, |