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
const http = require('http'); | |
http.createServer(function (req, res) { | |
if (req.url == '/script.js') { | |
res.writeHead(200, {'Content-Type': 'text/javascript'}); | |
res.end('console.log("title: " + document.title);' | |
+ 'setTimeout(function() {' | |
+ ' console.log("title:" + document.title);' | |
+ '}, 300);' |
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
module Main where | |
import Prelude hiding (sequence) | |
import Control.Concurrent | |
import Data.Foldable | |
import Data.Traversable | |
data Philosopher = Philosopher | |
{ name :: String | |
, left :: Int |
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
{-# LANGUAGE BangPatterns #-} | |
module Main (main) where | |
import Control.Concurrent.Async (mapConcurrently) | |
import Control.Monad.Writer (Writer, runWriter, execWriter, tell) | |
import Control.Parallel (pseq, par) | |
import Data.Foldable (foldl', fold) | |
import Data.Monoid ((<>)) | |
import Data.Vector (Vector) | |
import Data.Vector.Generic ((!)) |
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
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
module LossyHistogram | |
( Histogram | |
, histResolution | |
, histMagnitude | |
, histBuckets | |
, mkHistogram | |
, fromList | |
, keys |
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
defmodule CSV do | |
defp linesTransform(str, acc) do | |
case String.split(str, ~r/\n|\r\n/) do | |
[] -> {:halt, acc} | |
[head] -> {[], acc <> head} | |
[head | tail] -> | |
interspersedLines = Enum.take(tail, Enum.count(tail) - 1) | |
{[acc <> head] ++ interspersedLines, List.last tail} | |
end |
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
function accountAdd (foo, x) { | |
return foo.account + x | |
} | |
// accountAdd exhibits stamp coupling and data coupling. |
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
{-# LANGUAGE NoImplicitPrelude #-} | |
import Data.Foldable | |
import Control.Applicative | |
data Either a b = Left a | Right b | |
data Eithers t a b | |
= Eithers | |
{ lefts :: t a | |
, rights :: t b |
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
" Enable eslint for given project buffer | |
" Store current cwd | |
let s:prev_cwd = getcwd() | |
" change path to project root for current buffer | |
let s:project_cwd = split(expand('%:p:h'), "js")[0] | |
lcd `=s:project_cwd` | |
" Assign proper eslint vars for this buffer | |
let s:eslint_path = system('PATH=$(npm bin):$PATH && which eslint') |
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
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
module Main where | |
import Prelude hiding (readFile, writeFile) | |
import Control.Monad.Trans | |
import Control.Monad.State | |
import qualified System.IO as SIO | |
import Data.Map (Map) | |
import qualified Data.Map as Map | |
import Data.Maybe |
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
{ | |
"adaptiveLowestDomain": "aengesha", | |
"adaptiveLevelsPassed": 0, | |
"domainDetails": [ | |
{ | |
"adaptiveStandardProgression": [ | |
{ | |
"changeDate": "2017-08-02T16:03:46.936525Z", | |
"standardId": "ohbeecei" | |
} |
OlderNewer