Skip to content

Instantly share code, notes, and snippets.

View nicu-chiciuc's full-sized avatar
:shipit:

Nicu nicu-chiciuc

:shipit:
View GitHub Profile
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),
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));
}
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)
.....#..
....#...
....#...
...#....
........
........
......#.
......#.
var stringToMatrix = string => string.split`\n`.map(line => line.split``)
var rawString =
`.....#..
....#...
....#...
...#....
........
........
......#.
"use strict";
var stringToMatrix = string => string.split`\n`.map(line => line.split``)
var rawString =
`........
....#...
....#...
...#....
........
........
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);
}
});
import { Meteor } from "meteor/meteor";
import { getRandomNumber } from "../imports/api/methods/getRandomNumber";
Meteor.startup(() => {
console.log(getRandomNumber.call({ min: 4, max: 40 }));
});
import React from "react";
import { Meteor } from "meteor/meteor";
export default class App extends React.Component {
state = {
randomNumber: null
};
componentWillMount() {
Meteor.call(
// 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;