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 App = () => { | |
const points = symmetricalCurvePoints({ | |
controlX: 10, | |
endpointX: 35, | |
endpointDistance: 15, | |
controlDistance: 35 | |
}) | |
return ( | |
<div> | |
<svg |
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 symmetricalCurvePoints = ({ controlX, endpointX, endpointDistance, controlDistance}) => ( | |
[ | |
[endpointX, 50 - endpointDistance / 2], | |
[controlX, 50 - controlDistance / 2], | |
[controlX, 50 + controlDistance / 2], | |
[endpointX, 50 + endpointDistance / 2] | |
] | |
) |
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 Guide = ({ start, end }) => { | |
return [ | |
<circle fill="gray" opacity={0.5} cx={start[0]} cy={start[1]} r={1} />, | |
<path | |
stroke="gray" | |
strokeWidth="1" | |
strokeOpacity={0.5} | |
fill="transparent" | |
d={line(start, 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
const curve = (start, control1, control2, end) => { | |
return [ | |
"M", | |
start.join(" "), | |
"C", | |
control1.join(" "), | |
control2.join(" "), | |
end.join(" ") | |
].join(" "); | |
} |
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
{ | |
"[svg xmlns=http://www.w3.org/2000/svg viewBox='0 0 512 512']": [ | |
{"[title]": "HTML5 Logo"}, | |
"[polygon fill='#E44D26' points='107.644,470.877 74.633,100.62 437.367,100.62 404.321,470.819 255.778,512']", | |
"[polygon fill='#F16529' points='256,480.523 376.03,447.246 404.27,130.894 256,130.894']", | |
"[polygon fill='#EBEBEB' points='256,268.217 195.91,268.217 191.76,221.716 256,221.716 256,176.305 255.843,176.305 142.132,176.305 143.219,188.488 154.38,313.627 256,313.627']", | |
"[polygon fill='#EBEBEB' points='256,386.153 255.801,386.206 205.227,372.55 201.994,336.333 177.419,336.333 156.409,336.333 162.771,407.634 255.791,433.457 256,433.399']", | |
"[path d='M108.382,0h23.077v22.8h21.11V0h23.078v69.044H152.57v-23.12h-21.11v23.12h-23.077V0z']", | |
"[path d='M205.994,22.896h-20.316V0h63.72v22.896h-20.325v46.148h-23.078V22.896z']", | |
"[path d='M259.511,0h24.063l14.802,24.26L313.163,0h24.072v69.044h-22.982V34.822l-15.877,24.549h-0.397l-15.888-24.549v34.222h-22.58V0z']", |
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
// ---- | |
// Sass (v3.4.21) | |
// Compass (v1.0.3) | |
// ---- | |
// sass scoping | |
body { | |
$wow: url(doge.jpg); | |
background-image: $wow; | |
} |
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
class Buzzer { | |
constructor(message, factor) { | |
this.factor = factor; | |
this.message = message; | |
} | |
buzz(number) { | |
if (number % this.factor == 0) { | |
console.log(this.message); | |
return 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
// add ;0 to suppress long results, like a process or a mongoose connection | |
process;0 | |
// capture information from async calls. doesn't work on calls that use the arity. make a custom call for those. | |
var results = [], capture = function() { results.unshift([].slice.call(arguments)) } | |
// handle uncaught exceptions so a mistake in the console doesn't bounce you out of your session | |
process.on('uncaughtException', function(err) { console.log('***uncaught***', err); });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
s/expect(\([^)]*\)).to /\1.should / | |
s/eq(\([^)]\+\))/== \1/ | |
s/JSON.parse.*)$/\0.with_indifferent_access/ | |
s/\['\([^']\+\)'\]/[:\1]/g |
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
enum EntreeType : Int { | |
case Burrito, BurritoBowl, CrispyTacos, SoftTacos, Salad | |
} | |
enum Filling : Int { | |
case Chicken, Steak, Barbacoa, Carnitas, Sofritas, Veggie | |
var price : Int { | |
get { | |
switch self { | |
case .Chicken, .Sofritas, .Veggie { |