This file contains hidden or 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 isPrime = (function () { | |
var regexp = /^1?$|^(11+?)\1+$/; | |
return function isPrime(num) { | |
return !(regexp.test(Array(num + 1).join('1'))); | |
} | |
}()); |
This file contains hidden or 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
if (x == 2) | |
{ | |
auto y = new List<int>(); | |
… | |
} | |
// latwo taki blok zamienić na fragment, który wykonuje się zawsze, | |
// poprzez zakomentowanie tylko jednej linijki: |
This file contains hidden or 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 fileName = process.argv[2]; | |
if (!fileName) { | |
console.error('No file input!'); | |
return; | |
} | |
var Iconv = require('iconv').Iconv; | |
var fs = require('fs'); |
This file contains hidden or 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
/** | |
* Observer pattern - simple implementation | |
* By Michał Miszczyszyn, 2016 | |
*/ | |
class Observer { | |
constructor() { | |
this.observers = []; | |
} |
This file contains hidden or 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
angular.module('myApp', []); |
This file contains hidden or 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 onCopy(e) { | |
try { | |
e.clipboardData.setData('Text', 'tekst do skopiowania'); | |
e.preventDefault(); | |
} catch (err) { | |
console.error(err); | |
} | |
} | |
function onClick() { |
This file contains hidden or 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 Singleton { | |
private constructor() { } | |
private static instance = new Singleton(); | |
public static getInstance() { | |
return this.instance; | |
} | |
} |
This file contains hidden or 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
// Thanks to https://gist.github.com/quezak/0a9f33d20aa0c13fd86f547f75d9da47 | |
import { Plugin } from '@hapi/hapi'; | |
import { | |
contextNs, | |
setContext, | |
getContext, | |
updateContext, | |
USER_CONTEXT_KEY, | |
} from './hapi-zcontext'; |
This file contains hidden or 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, { MouseEventHandler } from "react"; | |
import { Modal, ModalHeader, ModalFooter, ModalBody, Button } from "reactstrap"; | |
import YouTube, { | |
YouTubeProps, | |
Options as YouTubeOptions, | |
} from "react-youtube"; | |
import Vimeo from "@u-wave/react-vimeo"; | |
import ReactDOM from "react-dom"; | |
import "./style.css"; | |
import { modalData as ModalData } from "../../interfaces/modalData"; |
This file contains hidden or 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
// @ts-check | |
/** | |
* @typedef {Object} WorkerData | |
* @property {number} howMany | |
*/ | |
const { | |
Worker, isMainThread, parentPort, workerData | |
} = require('worker_threads'); |