Skip to content

Instantly share code, notes, and snippets.

View fmal's full-sized avatar
:octocat:
:octocat:‎ ‎‎‎ ‎ ‎:octocat:

Filip Malinowski fmal

:octocat:
:octocat:‎ ‎‎‎ ‎ ‎:octocat:
View GitHub Profile
@fmal
fmal / gh-actions-hook.php
Created June 6, 2020 10:49
actions hook
<?php
function process ($collection, $data) {
$collectionsToWatch = ['events'];
if (!in_array($collection, $collectionsToWatch)) {
return;
}
$data = [
/**
* Get the type size for the given step
* @param {number} step
* @returns {number}
*/
export function getTypeSize(step) {
if (step <= 1) {
return 12;
}
<?php
define('PATH_IMAGE_CACHE', 'cache/');
define('DIR_IMAGE_CACHE', DIR_IMAGE . PATH_IMAGE_CACHE);
define('DIR_IMAGE_FTP', DIR_IMAGE . 'ftp/');
class Image
{
function __construct(&$locator)
{
@fmal
fmal / fontsquirrel.png
Last active May 27, 2022 06:11
Font subsetting using pyftsubset
fontsquirrel.png
@fmal
fmal / Makefile
Created January 16, 2020 22:29 — forked from fangel/Makefile
Font subsetting using pyftsubset + sfnt2woff-zopfli
# The following variables determine which directories to look for input fonts,
# and which directory to place the output fonts in.
INDIR = input
INPUT_EXT = woff
OUTDIR = output
SUBSET_FILE = subset.txt
SUBSET_FLAGS = --layout-features='' --obfuscate-names --glyphs="space"
ZOPFLI_ITERATIONS = 15
ifneq ($(shell echo $$ITERATIONS),)
@fmal
fmal / rollup.config.js
Created December 26, 2019 21:36
rollup
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import replace from '@rollup/plugin-replace';
import url from '@rollup/plugin-url';
import postcss from 'rollup-plugin-postcss';
import filesize from 'rollup-plugin-filesize';
import buildPathsHelpers from './tasks/buildPathsHelpers';
brew cask install homebrew/cask-versions/adoptopenjdk8

Keybase proof

I hereby claim:

  • I am fmal on github.
  • I am fima1 (https://keybase.io/fima1) on keybase.
  • I have a public key ASD8a7v2_5GSzRdLjwTkTeSVRAPm62k3VGsCA1VrrMJmawo

To claim this, I am signing this object:

@fmal
fmal / disk-alert.sh
Last active September 24, 2019 09:11
#!/bin/sh
# alert level in percent
ALERT=90
TEAMS_WEBHOOK_URL="https://outlook.office.com/<webhook>"
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | grep "/dev/[a-z][a-z][a-z][0-9]\|:" | while read output;
do
#echo $output
usepercent=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
filesystem=$(echo $output | awk '{ print $2 }' )
import { Component } from 'react';
import PropTypes from 'prop-types';
export default class ControlledComponent extends Component {
isControlledProp = key => Object.prototype.hasOwnProperty.call(this.props, key);
getControlledState = (state = this.state) => {
return Object.keys(state).reduce((combinedState, key) => {
combinedState[key] = this.isControlledProp(key)
? this.props[key]