duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
// Drop this in as the first plugin in a webpack config | |
{ | |
apply: function(compiler) { | |
var start; | |
compiler.plugin(['watch-run', 'run'], function(compiler, cb) { | |
start = Date.now(); | |
cb(); | |
}); | |
compiler.plugin('make', function(compilation, cb) { | |
console.log('pre-make', Date.now() - start); |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import { createStore, combineReducers } from 'redux' | |
import * as R from 'ramda' | |
// composition helper | |
const combine = R.curry((c, o) => x => (<div>{c(x)} {o(x)}</div>)) | |
const combineComponents = (...args) => { | |
const [first, ...rest] = args | |
return R.reduce((acc, c) => combine(acc, c), first, rest) |
// from the brilliant mind of sb | |
var _catch = Promise.prototype.catch; | |
Promise.prototype.catch = function () { | |
return _catch.call(this, function (err) { setTimeout(function () { throw(err); }, 0); }); | |
} | |
const React = require('react'); | |
const _ = require('lodash'); | |
var model = new falcor.Model({ | |
cache: { | |
movies: [ | |
{ | |
title: "Daredevil", | |
plot: "Marvel lol", | |
year: "2015-", |
react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
export default class WebStorage { | |
constructor(key, storageArea = window.localStorage) { | |
this.key = key; | |
this.storageArea = storageArea; | |
} | |
load(defaultValue) { | |
const serialized = this.storageArea.getItem(this.key); | |
return serialized === null ? defaultValue : this.deserialize(serialized); | |
} |
#!/bin/bash | |
if [ "$GIT_SSH_KEY" != "" ]; then | |
echo "Cleaning up SSH config" >&1 | |
echo "" >&1 | |
# Now that npm has finished running, | |
# we shouldn't need the ssh key/config anymore. | |
# Remove the files that we created. | |
rm -f ~/.ssh/config | |
rm -f ~/.ssh/deploy_key |
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` or `git checkout` if a specified file was changed | |
# Run `chmod +x post-checkout` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && echo " * changes detected in $1" && echo " * running $2" && eval "$2" |
-- requires subliminal, version 1.0 or newer | |
-- default keybinding: b | |
-- add the following to your input.conf to change the default keybinding: | |
-- keyname script_binding auto_load_subs | |
local utils = require 'mp.utils' | |
function load_sub_fn() | |
subl = "/usr/local/bin/subliminal" -- use 'which subliminal' to find the path | |
mp.msg.info("Searching subtitle") | |
mp.osd_message("Searching subtitle") | |
t = {} |