(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
The final result: require() any module on npm in your browser console with browserify
This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.
Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.
This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016
// ------------ | |
// counterStore.js | |
// ------------ | |
import { | |
INCREMENT_COUNTER, | |
DECREMENT_COUNTER | |
} from '../constants/ActionTypes'; | |
const initialState = { counter: 0 }; |
import { createStore } from 'redux'; | |
import { performanceMiddleware, performanceReducer, performancePrintTable } from './redux/util/performance'; | |
import thunkMiddleware from 'redux/lib/middleware/thunk'; | |
import promiseMiddleware from './redux/middleware/promiseMiddleware'; | |
import * as reducers from './reducers/index'; | |
// Util functions. | |
function asyncAction(promise, request, success, failure) { | |
return { types: [request, success, failure], promise }; | |
} |
import { graphql, GraphQLString, GraphQLInt } from 'graphql'; | |
import { objectType, enumType, schemaFrom, listOf } from 'graphql-schema'; | |
import request from 'promisingagent'; | |
const repositorySortEnum = enumType('RepositorySort') | |
.value('CREATED', 'created') | |
.value('UPDATED', 'updated') | |
.value('PUSHED', 'pushed') | |
.value('FULL_NAME', 'full_name') | |
.end(); |
'use strict'; | |
var fs = require('fs'); | |
var gm = require('gm'); | |
var but = require('but'); | |
var path = require('path'); | |
var contra = require('contra'); | |
var Imagemin = require('imagemin'); | |
var pngquant = require('imagemin-pngquant'); | |
var mozjpeg = require('imagemin-mozjpeg'); |