Moved to https://github.com/kbilsted/Functional-core-imperative-shell/blob/master/README.md
This file contains 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
# Replace "search" with "replacement" in "input" (all text) | |
on replace_string(input, search, replacement) | |
set oldDelim to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to search | |
set textItems to every text item of input | |
set AppleScript's text item delimiters to replacement | |
set res to textItems as string | |
set AppleScript's text item delimiters to oldDelim | |
return res |
This file contains 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
/* | |
Load Sinon.JS in the SpecRunner: | |
<script type="text/javascript" src="lib/jasmine-1.0.1/jasmine.js"></script> | |
<script type="text/javascript" src="lib/jasmine-1.0.1/jasmine-html.js"></script> | |
<script type="text/javascript" src="sinon-1.0.0.js"></script> | |
<script type="text/javascript" src="sinon-ie-1.0.0.js"></script> | |
http://cjohansen.no/sinon/ | |
*/ |
This file contains 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
var express = require('express'); | |
var path = require('path'); | |
var webpackConfig = require('./webpack.config'); | |
var webpack = require('webpack'); | |
var webpackDevMiddleware = require('webpack-dev-middleware'); | |
var webpackHotMiddleware = require('webpack-hot-middleware'); | |
var proxyMiddleware = require('http-proxy-middleware'); | |
var devConfig = webpackConfig.devServer; | |
var app = express(); |
This file contains 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
# URI of the local (caching) HTTP proxy | |
LOCAL_HTTP_PROXY = 'http://192.168.33.200:8123' | |
# Configures vagrant-cachier and vagrant-proxyconf. | |
# Should be called only on "local machine" providers. | |
def configure_caching(config) | |
if Vagrant.has_plugin?('vagrant-cachier') | |
config.cache.enable_nfs = true | |
config.cache.enable :gem | |
config.cache.enable :npm |
This file contains 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
/** | |
* http://stackoverflow.com/questions/1062113/fastest-way-to-write-huge-data-in-text-file-java | |
* | |
* I have to write huge data in text[csv] file. I used BufferedWriter to write the data and it | |
* took around 40 secs to write 174 mb of data. Is this the fastest speed java can offer? | |
* bufferedWriter = new BufferedWriter ( new FileWriter ( "fileName.csv" ) ); | |
* | |
* You might try removing the BufferedWriter and just using the FileWriter directly. On a modern system | |
* there's a good chance you're just writing to the drive's cache memory anyway. | |
* It takes me in the range of 4-5 seconds to write 175MB (4 million strings) -- this is on a dual-core 2.4GHz Dell |
This file contains 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
/** | |
* ``` | |
* Does JDK8's Optional class satisfy the Monad laws? | |
* ================================================= | |
* 1. Left identity: true | |
* 2. Right identity: true | |
* 3. Associativity: true | |
* | |
* Yes, it does. | |
* ``` |
This file contains 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
package bar.foo.lenses; | |
import java.util.function.BiFunction; | |
import java.util.function.Function; | |
public class Lens<A, B> { | |
private final Function<A, B> getter; | |
private final BiFunction<A, B, A> setter; |
This file contains 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
{ | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"project": "./tsconfig.json", | |
"tsconfigRootDir": "." | |
}, | |
"env": { | |
"browser": true, | |
"jest/globals": true | |
}, |
This file contains 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
import { setupWorker, rest } from "msw"; | |
export const ExampleStory = () => { | |
... | |
}; | |
ExampleStory.decorators = [ | |
(Story) => { | |
const [ready, setReady] = React.useState(false); |
OlderNewer