Skip to content

Instantly share code, notes, and snippets.

View Kamilczak020's full-sized avatar
🏳️
Surrendering to code.

Kamil Solecki Kamilczak020

🏳️
Surrendering to code.
  • coursedog.com
  • Poland
View GitHub Profile
@Kamilczak020
Kamilczak020 / router.js
Last active July 29, 2017 13:19
Basic NodeJS router
var url = require('url');
var Router = function() {
this.handlers = [];
this.add = add;
this.match = match;
this.handleInvalidRoute = handleInvalidRoute;
}
@Kamilczak020
Kamilczak020 / Evaluate
Created August 10, 2017 14:33
Evaluate stuff
const data = [
{x: -4, y: -5, expected: true},
{x: 4, y: 5, expected: true},
{x: -4, y: 5, expected: false},
{x: 4, y: -5, expected: false},
{x: -5, y: -4, expected: false},
{x: 5, y: 4, expected: false},
{x: -5, y: 4, expected: false},
{x: 5, y: -4, expected: false}
@Kamilczak020
Kamilczak020 / Boyer-Moore.js
Created October 16, 2017 21:58
Boyer Moore string search algorithm implementation in Javascript
/**
* Returns the index of the first occurence of given string in the phrase
* In case of no match, returns -1
*
* @param text string to be searched
* @param pattern string to be found in the text
*/
export function boyerMooreSearch(text: string, pattern: string): number {
// Handle edge case
@Kamilczak020
Kamilczak020 / colorConversion.ts
Last active November 23, 2017 14:18
Hex to HSL and HSL to Hex
/**
* Representation of color in HSL (hue, saturation, luminance) format.
*/
interface HslColor {
hue: number;
saturation: number;
luminance: number;
}
/**
'use strict';
var _templateObject = _taggedTemplateLiteral([''], ['']),
_templateObject2 = _taggedTemplateLiteral(['console.log(\'hello\')'], ['console.log\\x28\'hello\'\\x29']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Foo = function Foo() {
class Foo { constructor() { throw 'Nope!' } } Foo.constructor`console.log\x28'hello'\x29```;
> undefined; logged: "hello".
@Kamilczak020
Kamilczak020 / .stylelintrc
Last active November 21, 2018 12:25
CSS Linting config
{
"plugins": [
"stylelint-order"
],
"rules": {
"at-rule-empty-line-before": "always",
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always",
"at-rule-semicolon-newline-after": "always",
"at-rule-semicolon-space-before": "never",

Keybase proof

I hereby claim:

  • I am kamilczak020 on github.
  • I am greenchill (https://keybase.io/greenchill) on keybase.
  • I have a public key ASDKZ8eT0ibeUpsWE1n8cpRVxMilQFOee9Sto3d_EUugTQo

To claim this, I am signing this object:

/*BEGIN PS4 Controller Styling*/
.controller.custom {
background: url(https://imgur.com/WEULFfI.png);
height: 598px;
width: 806px;
/* margin-left: -403px;
margin-top: -280px;*/
}
.custom.disconnected {