Skip to content

Instantly share code, notes, and snippets.

View attitude's full-sized avatar

Martin Adamko attitude

View GitHub Profile
@attitude
attitude / stringListCombinations.js
Created March 24, 2018 20:13
Generates combinations of strings within array of strings
// @flow
export const stringListCombinationsWithoutSort = (a: string[], transformer: (str: string) => string): string[] => {
return a.reduce((accumulator, propName, i) => [
propName,
...accumulator,
...(accumulator.map((s) => (s + (transformer ? transformer(propName) : propName)))),
], [])
}
@attitude
attitude / remove-extra-line-height.less
Created February 19, 2017 18:12
LESS CSS mixin to remove extra optical space above and below the block of text caused by how the browser distributes the line height property.
.remove-extra-line-height(@line-height: 1, @m-height: 0.7, @coef: 0.5) {
line-height: 1em * @line-height;
&:before,
&:after {
content: "";
display: table;
}
&:before {
@attitude
attitude / hideGoogleSerps.js
Last active May 29, 2016 13:37
Tiny script to dim some Google SERPs in Chrome; requires Control Freak extension.
(function (w, domains) {
'use strict';
var to,
// Google SERP div#search
search,
// Array of links
links,
// Passed arg iterator
domainsI,
// Passed arg length
@attitude
attitude / hideGoogleSerp.js
Last active May 29, 2016 12:14
Script to dim some SERP in Chrome; requires Control Freak extension.
(function(domains) {
var to,
observer,
// Google SERP div#search
search,
// Array of links
links,
// Passed arg iterator
domainsI,
// Passed arg length
@attitude
attitude / normalize.less
Last active August 8, 2016 14:00
Normalize.less [Bot updated on each change to original normalize.css]
/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */
// 1. Change the default font family in all browsers (opinionated).
// 2. Correct the line height in all browsers.
// 3. Prevent adjustments of font size after orientation changes in IE and iOS.
// Document
html {
font-family: sans-serif; // 1
@attitude
attitude / platform.js
Created February 27, 2016 09:22
Platform CSS class on HTML tag
/**
* Platform CSS class on HTML tag inspired by https://github.com/driftyco/ionic/blob/67ef9ebde21ac64e1f9e3db43b16c2db7ed2256d/js/utils/platform.js
*/
(function(w, el) {
var platformName,
IOS = 'ios',
ANDROID = 'android',
WINDOWS_PHONE = 'windowsphone',
EDGE = 'edge',
CROSSWALK = 'crosswalk';
@attitude
attitude / responsive-github-com.css
Created July 31, 2015 12:13
Responsive github.com CSS. Use e.g Control Freak Chrome extension to inject this CSS.
.wrapper .header,
.site-footer {
min-width: auto;
padding: 10px;
}
body .container {
max-width: 980px;
width: auto;
}
@attitude
attitude / officeOfHelena.js
Created November 18, 2014 11:08
Description for my my friend's IT colleagues to explain them how to leave door open/closed properly.
/*! Closing the Door by Martin Adamko (c) 2014, MIT Licence */
var officeOfHelena = {
person: {
name: "Helena",
surname: "Székhelyi"
}
};
(function(office) {
@attitude
attitude / content.yaml
Created May 1, 2014 01:31
First site contnt data for example usage of Macaw together with Publisher
---
################################################################################
#
# COLLECTIONS
#
################################################################################
_id: homepage
_type: collection
route: /
template: homepage
@attitude
attitude / composer.json
Last active May 7, 2021 18:48
Function to generate a slug (a normalized URL sanitized string)
{
"name": "attitude/generate_slug",
"autoload": {
"files": ["function-generate_slug.php"]
}
}