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 compare = (n, m, | |
x=t=>(typeof t)[0]=='s'?t.length:NaN, | |
u=t=>[...t.toUpperCase()], | |
a=u(n), | |
b=u(m), | |
) => | |
x(n)==x(m) ? | |
[ | |
a.reduce((c,l,i,o,j=b.indexOf(l)) => | |
c+ (j==i && (b[j]=1) ), 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
getTitle(state: RouterState, parent: ActivatedRoute) { | |
const data = []; | |
if (parent && parent.snapshot.data && parent.snapshot.data.title) { | |
data.push(parent.snapshot.data.title); | |
} | |
if (state && parent) { | |
data.push(...this.getTitle(state, parent.firstChild)); | |
} |
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
f = (s,y=' _ | | | _||_||_ 025133046044153064065033055054'.match(/.{3}/g))=>[...' ..'].map((v,i,_,a=n=>y[y[+s[n]+7][i]])=>a(0)+a(1)+v+a(3)+a(4)).join`\n` | |
some = f('09:36') | |
console.log(f('11:11')) | |
console.log(f('00:88')) | |
console.log(f('12:34')) | |
console.log(some) | |
console.log(f.toString().length) |
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
.....#.. | |
....#... | |
....#... | |
...#.... | |
........ | |
........ | |
......#. | |
......#. | |
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 stringToMatrix = string => string.split`\n`.map(line => line.split``) | |
var rawString = | |
`.....#.. | |
....#... | |
....#... | |
...#.... | |
........ | |
........ | |
......#. |
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
"use strict"; | |
var stringToMatrix = string => string.split`\n`.map(line => line.split``) | |
var rawString = | |
`........ | |
....#... | |
....#... | |
...#.... | |
........ | |
........ |
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 { ValidatedMethod } from "meteor/mdg:validated-method"; | |
const getRandomNumber = new ValidatedMethod({ | |
name: "global.getRandomNumber", | |
validate: null, | |
run({ min, max }) { | |
return Math.round(Math.random() * (max - min) + min); | |
} | |
}); |
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 { Meteor } from "meteor/meteor"; | |
import { getRandomNumber } from "../imports/api/methods/getRandomNumber"; | |
Meteor.startup(() => { | |
console.log(getRandomNumber.call({ min: 4, max: 40 })); | |
}); |
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 React from "react"; | |
import { Meteor } from "meteor/meteor"; | |
export default class App extends React.Component { | |
state = { | |
randomNumber: null | |
}; | |
componentWillMount() { | |
Meteor.call( |
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
// Type definitions for mdg:validated-method meteor package | |
// Project: https://atmospherejs.com/mdg/validated-method | |
// Definitions by: Dave Allen <https://github.com/fullflavedave> | |
interface ValidatedMethod_Static { | |
new(options: { | |
name: string; | |
mixins?: Function[]; | |
validate: (args: { [key: string]: any; }) => void; // returned from SimpleSchemaInstance.validator() method; |
OlderNewer