Skip to content

Instantly share code, notes, and snippets.

Avatar
❤️
https://github.com/sponsors/typeofweb

Michał Miszczyszyn mmiszy

❤️
https://github.com/sponsors/typeofweb
View GitHub Profile
@mmiszy
mmiszy / hapi-cls.ts
Last active May 1, 2020
Hapi plugin for CLS
View hapi-cls.ts
// Thanks to https://gist.github.com/quezak/0a9f33d20aa0c13fd86f547f75d9da47
import { Plugin } from '@hapi/hapi';
import {
contextNs,
setContext,
getContext,
updateContext,
USER_CONTEXT_KEY,
} from './hapi-zcontext';
View singleton.ts
class Singleton {
private constructor() { }
private static instance = new Singleton();
public static getInstance() {
return this.instance;
}
}
View clipboard-copy.js
function onCopy(e) {
try {
e.clipboardData.setData('Text', 'tekst do skopiowania');
e.preventDefault();
} catch (err) {
console.error(err);
}
}
function onClick() {
@mmiszy
mmiszy / app.js
Last active May 28, 2018
Przykładowa aplikacja AngularJS oparta o komponenty
View app.js
angular.module('myApp', []);
@mmiszy
mmiszy / Observer.js
Created May 5, 2016
Observer pattern - simple implementation
View Observer.js
/**
* Observer pattern - simple implementation
* By Michał Miszczyszyn, 2016
*/
class Observer {
constructor() {
this.observers = [];
}
View konwersja.js
var fileName = process.argv[2];
if (!fileName) {
console.error('No file input!');
return;
}
var Iconv = require('iconv').Iconv;
var fs = require('fs');
View p.cpp
if (x == 2)
{
auto y = new List<int>();
}
// latwo taki blok zamienić na fragment, który wykonuje się zawsze,
// poprzez zakomentowanie tylko jednej linijki:
View isPrime.js
var isPrime = (function () {
var regexp = /^1?$|^(11+?)\1+$/;
return function isPrime(num) {
return !(regexp.test(Array(num + 1).join('1')));
}
}());
View 0-instructions.md

Write a program in your favourite programming language to compute the sum of the first N even numbers in the Fibonacci sequence, then display the sum of its digits.

E.g.: Where N = 5, the answer is 17, since:

  1. The Fibonacci sequence is 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, ...;
  2. The first 5 even numbers are 0, 2, 8, 34, and 144;
  3. The sum of these numbers is 188;
  4. The sum of the digits of this answer is 17 (1 + 8 + 8).
View labpki.sh
#####################
# Hasla:
# CA : cakey
# klient : klientkey
# paczka : lab142
#####################
#############################
# RECZNE ZMIANY W KONFIGU
#
You can’t perform that action at this time.