const float PI = 3.1415926535897932384626433832795;
const float PI_2 = 1.57079632679489661923;
const float PI_4 = 0.785398163397448309616;
float PHI = (1.0+sqrtf(5.0))/2.0;
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
export const chaosTestStrings = (): void => { | |
const textNodes = getAllTextNodes(document.body); | |
for (const node of textNodes) { | |
const textNodeLength = node.textContent ? node.textContent.length : 0; | |
if (node.textContent === null) { | |
return; | |
} | |
if (node.parentElement instanceof Element) { | |
if (node.parentElement.dataset.originalText === undefined) { |
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
let all = Js.Promise.all; | |
let resolve = Js.Promise.resolve; | |
let reject = Js.Promise.reject; | |
let andThen = | |
(p: Js.Promise.t('a), fn: 'a => Js.Promise.t('b)): Js.Promise.t('b) => | |
p->Js.Promise.then_(fn, _); |
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
/* Has side-effects */ | |
module Option = Core.Option; | |
let enable_debug_sf = () => Netsmtp.Debug.enable := true; | |
type mail_client = { | |
domain: string, | |
client: Netsmtp.client, | |
tls: (module Netsys_crypto_types.TLS_CONFIG), | |
}; |
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
.bg-graph-paper { | |
background-color: #fff; | |
background-image: linear-gradient(rgba(244,244,250,.8) 1px,transparent 0), | |
linear-gradient(#f4f4fa 1px,transparent 0), | |
linear-gradient(90deg,rgba(244,244,250,.8) 1px,transparent 0), | |
linear-gradient(90deg,#f4f4fa 1px,transparent 0), | |
linear-gradient(transparent 3px,#fff 0,#fff 94px,transparent 0), | |
linear-gradient(90deg,#f4f4fa 3px,transparent 0,transparent 94px,#f4f4fa 0); | |
background-size: 24px 24px,96px 96px,24px 24px,96px 96px,96px 96px,96px 96px; | |
} |
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 StringContext = | |
Context.MakePair({ | |
type t = string; | |
let defaultValue = "Awesome"; | |
}); | |
let component = ReasonReact.statelessComponent("Tree"); | |
let make = _children => { |
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 Store = { | |
type action = | |
| Increase | |
| Decrease | |
| SetUsername(string); | |
type state = { | |
count: int, | |
username: string, | |
}; | |
type storeBag = { |
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
#!/usr/bin/env babel-node | |
require('dotenv').config() | |
import contentful from 'contentful' | |
import fs from 'fs-extra-promise' | |
// Contentful Config | |
const apiToken = process.env.CONTENTFUL_DELIVERY_API_TOKEN | |
const spaceId = process.env.CONTENTFUL_SPACE_ID | |
const client = contentful.createClient({ accessToken: apiToken, space: spaceId }) |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).