Skip to content

Instantly share code, notes, and snippets.

View mbixby's full-sized avatar

Michal Obrocnik mbixby

View GitHub Profile
@mbixby
mbixby / clip.js
Created January 22, 2024 13:42
Rich text clipboard
const clipboardItem = new ClipboardItem({
"text/plain": new Blob(
['https://example.com'],
{ type: "text/plain" }
),
"text/html": new Blob(
['<a href="https://example.com">Example link</a>'],
{ type: "text/html" }
),
"application/rtf": new Blob(
// .storybook/main.js
const excludedProps = ['as', 'forwardedAs', 'theme', 'ref']
module.exports = {
// ...
typescript: {
check: false,
checkOptions: {},
reactDocgen: react-docgen-typescript
reactDocgenTypescriptOptions: {

{ "telemetry.enableCrashReporter": false, "telemetry.enableTelemetry": false, "workbench.activityBar.visible": false, "editor.fontSize": 15.5, "editor.fontFamily": "Monaco Lives For Powerline", "editor.fontLigatures": true, "editor.wordWrap": "on", "editor.wordWrapColumn": 90, "editor.suggest.showStatusBar": true,

@mbixby
mbixby / prompt.sh
Created July 19, 2022 14:07
Prompt
PROMPT="${pwd} ${git}
%(?..)%B›%b%{$reset_color%} "
# Gun safety lock
alias rm "rm -i"
# General UNIX
alias cp='cp -iv'
alias df='df -h'
alias du='du -h'
@mbixby
mbixby / materialUiStyles.js
Created April 26, 2017 14:34
Extending Material UI styles
import { merge } from 'lodash'
// This module allows us to completely customize all of Material UI's JSS stylesheets
// to define our own theme.
//
// Note that you Material UI's JSS is often tied to application logic and you may
// deviate from the official Material UI spec.
//
// Unlike using the `overrides` feature of jss-theme-reactor, here you have access to
// the original calculated styles and theme. Notably you can do deep merge (lodash.merge)
@mbixby
mbixby / gist:3dae2026a77a9a3d3de9
Last active January 5, 2019 06:55
Webpack Named Modules Plugin
var RequestShortener = require("webpack/lib/RequestShortener");
var _ = require("lodash");
/**
* TODO Docs
* @example new NamedModulesPlugin(/^\.\/app\/(viewmodels|records|adapters)/, /^\.\/app\/(.*)\.js$/)
*/
function NamedModulesPlugin(fileWhitelistRegex, replacementRegex) {
this.fileWhitelistRegex = fileWhitelistRegex;
this.replacementRegex = replacementRegex;
@mbixby
mbixby / Incremental compilation output
Created September 12, 2013 13:30
Incremental compilation output from Grunt
⚡ gn watch:main annotations-client master *
Running "watch:main" (watch) task
Waiting...OK
>> File "app/abc.coffee" changed.
Running "coffee:compile" (coffee) task
File tmp/javascript/app/abc.js created.
Running "file_did_change" task
@mbixby
mbixby / Gruntfile.coffee
Last active December 19, 2015 12:09
Gruntfile
"use strict"
module.exports = (grunt) ->
grunt = (require 'grunt-utilities') grunt
# Note that for performance reasons we're only matching one level
# down: 'test/spec/{,*/}*.js'. If you want to match all subfolders,
# use 'test/spec/**/*.js'
grunt.initConfig
yeoman:
@mbixby
mbixby / Markdown.tmlanguage
Last active December 15, 2015 15:19
Quick fix for bullet coloring in Markdown.tmlanguage
<dict>
<key>begin</key>
<!-- By default, maximum number of spaces before the bullet
character is 3. To support multiple nested lists, I changed
it to infinite. -->
<string>^[ ]*([*+-])(?=\s)</string>
<key>captures</key>
<dict>
<key>1</key>
@mbixby
mbixby / EXTNull.h
Last active December 14, 2015 17:59
EXTNull
/**
EXTNull
Experimental
EXTNull is a subclass of NSNull that acts more like nil.
Calling unrecognized methods on EXTNull *will not* throw
a NSInvalidArgumentException but again return EXTNull.