// Option.ts
// definition
export class None {
readonly tag: 'None' = 'None'
let to_js_boolean b => if b { Js.true_ } else { Js.false_ }; | |
let optionMap fn opt_value => switch opt_value { | |
| None => None | |
| Some value => Some (fn value) | |
}; | |
module View = { | |
external view : ReactRe.reactClass = "View" [@@bs.module "react-native"]; | |
let createElement | |
accessible::(accessible:option bool)=? |
// Logs all calls to preventDefault / stopPropagation in an user-friendly way | |
if ( process.env.NODE_ENV !== "production" ) { | |
(function monkeyPatchEventMethods() { | |
const logEventMethodCall = (event,methodName) => { | |
const MinimumMeaninfulSelectors = 3; // how much meaningful items we want in log message | |
const target = event.target; | |
const selector = (function computeSelector() { |
show_icons() { | |
defaults write com.apple.finder CreateDesktop true | |
killall Finder | |
} | |
hide_icons() { | |
defaults write com.apple.finder CreateDesktop false | |
killall Finder | |
} |
{ | |
"presets": [ | |
"es2015", | |
"react" | |
], | |
"plugins": [ | |
"transform-es2015-spread", | |
"transform-object-rest-spread", | |
[ | |
"./node_modules/babel-plugin-jsx-import/src/index.js", |
Vim provides built-in mechanisms to search through projects in the form of the grep
command.
However, on large projects, grep is known to be slow; and hence people have been switching to simpler searchers like ack, and faster, parallel (metal?) searchers like ag and pt.
Correspondingly, several plugins have been created that integrate these tools in vim: ack.vim, ag.vim, etc.
However, it's actually very easy to get the functionalities these plugins provide (faster search, results in quickfix-window, jumps, previews, and so on) in vanilla Vim itself; in fact, Vim already populates the grep-search results in a quickfix window. We just need to tell Vim to do the following things (use-case: ag):
- Use ag as the default grep program
- Open quickfix window by default
- Create mappin
Earlier this year Facebook open sourced its React based rich text editing framework Draft.js. At Facebook it powers status updates, comments & notes. Others used it to build editors matching Medium’s experience.
Together with a whole team of open source contributors I built a plugin architecture on top of Draft.js. In this talk I walk you through the existing plugins and show how you can build your own feature-rich text editor for the web with only a handful lines of code. 🤓
Proposal for this year's Reactive lightning talks @ReactiveConf - If you want to see my talk, star this gist please :-) [Reactive Blogpost][reactive-conference-blogpost]
As a JavaScript developer, could you imagine using something else than Atom, Sublime or other IDE-like text-editors? During their daily work, people wrangle a lot with different applications, editors, windows, browsers and loose a lot of time because of their tools getting in their way.
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |