Skip to content

Instantly share code, notes, and snippets.

@SpadarShut
SpadarShut / main.js
Created May 5, 2022 18:58
Config Storybook 6 + Tailwind 3 + next.js 12
const path = require("path")
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin")
module.exports = {
stories: ["../ui-kit/**/*.stories.mdx", "../@(modules|ui-kit)/**/*.stories.@(js|jsx|ts|tsx)"],
staticDirs: ["../public"],
core: {
builder: "webpack5",
},
addons: [
@SpadarShut
SpadarShut / save-file-from-blob.ts
Created October 7, 2021 08:04
Save file to disk from blob or Response
export async function saveFileFromResponse(response: Response, filename?: string) {
filename = filename || getResponseAttachmentFileName(response) || 'file';
const data = await response.blob();
const type = data.type || 'application/octet-stream';
saveBlobAsFile(data, filename, type)
}
export function saveBlobAsFile(blob: Blob, fileName: string, mimeType: string){
if (typeof navigator.msSaveBlob === 'function') {
@SpadarShut
SpadarShut / pinch-zoom-directive.js
Last active August 29, 2015 14:27 — forked from ktknest/pinch-zoom-directive.js
pinch zoom in/out directive for AngularJS
// sample: http://codepen.io/ktknest/full/LDljw/
angular.module('app', [])
/**
* @ngdoc directive
* @name pinchZoom
* @restrict A
* @scope false
*
* @description
@SpadarShut
SpadarShut / dabblet.css
Created August 30, 2013 09:30
Untitled
.document-page__sheet {
display: inline-block;
background: #f00;
box-shadow: 0 2px 10px rgba(0,0,0,.3), inset 0 0 1px red;
}
.document-page__content {
display: inline-block;
}
/* THE IMAGE : */
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
/* Steps */
.steps {
margin: 25px 50px;
}
.step {
float: left;
width: 0;
text-align: center;
}