Skip to content

Instantly share code, notes, and snippets.

View borlaym's full-sized avatar

Marton Borlay borlaym

  • Budapest, Hungary
View GitHub Profile
@borlaym
borlaym / solution.js
Created October 3, 2019 12:47
The solution
function method(value: { prop?: string }) {
const savedProp = value.prop;
if (savedProp) {
otherMethod();
savedProp.charAt(0);
}
}
@borlaym
borlaym / full-issue.js
Created October 3, 2019 12:44
The full issue
var obj = { prop: "test" };
function otherMethod() {
delete obj.prop;
}
function method(value: { prop?: string }) {
if (value.prop) {
otherMethod();
value.prop.charAt(0);
@borlaym
borlaym / issue.js
Created October 3, 2019 12:39
The issue
function method(value: { prop?: string }) {
if (value.prop) {
otherMethod();
value.prop.charAt(0);
}
}
def addGame(gameId: Long) = Action.async { implicit request =>
request.body.asJson.map{json =>
for {
players <- json \ "players"
} yield Ok()
}.getOrElse(Future(BadRequest())
}
@borlaym
borlaym / width.js
Last active February 20, 2019 13:26
Grid width mixin
// @flow
import * as styled from 'styled-components';
const SMALL_COL_NUMBER = 6;
const MEDIUM_COL_NUMBER = 8;
const LARGE_COL_NUMBER = 12;
const XLARGE_COL_NUMBER = 12;
const SMALL_GUTTER = 16;
const MEDIUM_GUTTER = 24;
const LARGE_GUTTER = 24;
// components/Attribute.js
function Attribute(props) {
return (
<div>
<a onClick={props.onClick}>
{props.name}
</a>
</div>
);
atom-beautify
atom-ternjs
docblockr
emmet
highlight-selected
language-scala
language-soy
linter-eslint
pigments
react
@borlaym
borlaym / animals.json
Created December 15, 2014 13:38
Array of animal names
[
"Aardvark",
"Albatross",
"Alligator",
"Alpaca",
"Ant",
"Anteater",
"Antelope",
"Ape",
"Armadillo",
@borlaym
borlaym / no letters no digits
Last active August 29, 2015 14:05
Writing text in javascript with no letters and no digits
((+[])[(/./[(!(+[])+'')[(+[])]+(!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!(+[])+'')[(+[])]]+"")[+(!+[])+(!+[])+(!+[])]+(/./[(!(+[])+'')[(+[])]+(!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!(+[])+'')[(+[])]]+"")[+(!+[])+(!+[])+(!+[])+(!+[])+(!+[])+(!+[])]+((+(!+[])/(+[]))+'')[+(!+[])]+(!!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!(+[])+'')[(+[])]+(!(+[])+'')[+(!+[])]+(!(+[])+'')[+(!+[])+(!+[])]+(/./[(!(+[])+'')[(+[])]+(!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!(+[])+'')[(+[])]]+"")[+(!+[])+(!+[])+(!+[])]+(!(+[])+'')[(+[])]+(/./[(!(+[])+'')[(+[])]+(!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!(+[])+'')[(+[])]]+"")[+(!+[])+(!+[])+(!+[])+(!+[])+(!+[])+(!+[])]+(!(+[])+'')[+(!+[])]]+"")[(+(!+[])<<+(!+[])+(!+[])+(!+[]))+(!+[])+(!+[])+(!+[])]+((+[])/(+[])+'')[+(!+[])]+(!(+[])+'')[+(!+[])]+(/./[(!(+[])+'')[(+[])]+(!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!!(+[])+'')[+(!+[])+(!+[])+(!+[])]+(!(+[])+'')[(+[])]]+"")[+(!+[])
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-layout/core-layout.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">