Skip to content

Instantly share code, notes, and snippets.

View fmal's full-sized avatar
🕺

Filip Malinowski fmal

🕺
View GitHub Profile
@fmal
fmal / simplifyToken.js
Last active February 23, 2023 18:47
typescript/module-declarations format
export default function simplifyTokens(obj, mapper = token => token.value) {
const result = {};
for (const key in obj) {
if (!obj[key] || typeof obj[key] !== 'object') {
continue;
}
if ('value' in obj[key]) {
result[key] = mapper(obj[key]);
@fmal
fmal / rm.sh
Created January 23, 2022 17:26
rm android bloat
adb shell pm list packages | grep 'samsung'
pm disable-user com.samsung.android.bixby.service
pm disable-user com.samsung.android.bixby.agent
pm disable-user com.samsung.android.bixby.wakeup
pm disable-user com.samsung.android.visionintelligence
pm disable-user com.samsung.android.app.routines
pm uninstall --user 0 com.samsung.android.mdx
pm uninstall -k --user 0 com.samsung.android.bixby.es.globalaction
pm uninstall --user 0 com.microsoft.appmanager
@fmal
fmal / .huskyrc
Created September 30, 2020 20:13
Make husky hooks work for GUI Git clients when installing yarn from NPM
PATH="/Users/$(whoami)/.asdf/shims:/usr/local/bin:$PATH"
import PropTypes from 'prop-types';
import React from 'react';
import * as colors from '@powel/design-colors';
const uuid = () => {
let id = '';
let random;
let i;
for (i = 0; i < 32; i++) {
pyftsubset "Inter-roman.otf" --unicodes-file=unicodes.txt --layout-features="ss01,ss02,ss03,cpsp,kern,calt" --flavor="woff2" --output-file="inter-roman-subset.woff2"
pyftsubset "Inter-italic.otf" --unicodes-file=unicodes.txt --layout-features="ss01,ss02,ss03,cpsp,kern,calt" --flavor="woff2" --output-file="inter-italic-subset.woff2"
(function(window, document, powelUI, ARRAY) {
'use strict';
var reFileTrim = /^.+\/|\.[^\.]+$/g; // eslint-disable-line
var defaultViewBox = [0, 0, 560, 560];
var defaultElement = document.createElement('x');
var xmlns = 'http://www.w3.org/2000/svg';
function process(file) {
return new Promise(function(resolve) {
@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