Skip to content

Instantly share code, notes, and snippets.

View ctavan's full-sized avatar

Christoph Tavan ctavan

View GitHub Profile
@ctavan
ctavan / Reduce to 150 dpi average quality - STANDARD COMPRESSION.qfilter
Created November 15, 2022 13:26
Reduce to 150 dpi average quality - STANDARD COMPRESSION.qfilter
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Domains</key>
<dict>
<key>Applications</key>
<true/>
<key>Printing</key>
<true/>
@ctavan
ctavan / browser-build.diff
Last active December 2, 2021 22:07
uuid browser build without IE support
diff -ur dist-node-10/esm-browser/md5.js dist/esm-browser/md5.js
--- dist-node-10/esm-browser/md5.js 2021-12-02 13:15:02.000000000 +0100
+++ dist/esm-browser/md5.js 2021-12-02 22:48:16.000000000 +0100
@@ -20,11 +20,11 @@
*/
function md5(bytes) {
if (typeof bytes === 'string') {
- var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
+ const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
@ctavan
ctavan / github.md
Last active February 18, 2021 02:22
Git & Github

Git & Github

  • Consider using these useful git shortcuts.
  • Repositories:
    • All developers clone the repos from the github organization, never create forks into your private accounts.
  • Branches:
    • Understand git rebase.
    • Development is done in branches.
    • Name branches starting with the JIRA issue followed by an all-lowercase dash-separated descriptive name, e.g: ID-7-shoping-cart-prototype
  • Always rebase onto origin/master before merging into master, we want to get a clean master history which looks like this: branches

Keybase proof

I hereby claim:

  • I am ctavan on github.
  • I am ctavan (https://keybase.io/ctavan) on keybase.
  • I have a public key ASABxq9Uz6fewrw8b90TiKtxRootHXGuqHkvFd2QTNao2go

To claim this, I am signing this object:

commit ********b2a5c668b54348d0f3f891ddc58ef9f8
Author: Christoph Tavan <[email protected]>
Date: Mon Mar 11 16:53:10 2019 +0100
Fix sorting of error codes
Apparently with node 11 there's a subtle change in how array sorting
compare function return values are interpreted. According to the spec
the return value of 0 will not change the sorting. A negative return
value will sort the element below and must be used in this case.
@ctavan
ctavan / array-sort-node-10-11.js
Created March 11, 2019 21:24
Array Sort Behavior Node 10 and 11
const unsorted1 = [1, 0, 0, 1];
console.log(process.version, [...unsorted1], '->', unsorted1.sort(( value ) => value));
const unsorted2 = [1, -1, -1, 1];
console.log(process.version, [...unsorted2], '->', unsorted2.sort(( value ) => value));
import PropTypes from 'prop-types';
import React from 'react';
import Input, { InputLabel } from 'material-ui/Input';
import FormControl from 'material-ui/Form/FormControl';
import FormHelperText from 'material-ui/Form/FormHelperText';
import MenuItem from 'material-ui/Menu/MenuItem';
import Select from 'material-ui/Select';
const SelectFieldBase = (props) => {
@ctavan
ctavan / mutatable.jsx
Created January 17, 2017 12:13
mutatable react HOC
import hoistNonReactStatic from 'hoist-non-react-statics';
import React from 'react';
function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
}
// See: https://facebook.github.io/react/docs/higher-order-components.html
export default function mutatable({ mutationName = 'mutate' } = {}) {
return (SourceComponent) => {
@ctavan
ctavan / git-shortcuts
Last active December 13, 2018 14:43
git-shortcuts
# Originally authored by https://github.com/dohse
#
# To activate you have to save this to a file and add:
# source /path/to/these/git-shortcuts
# to your ~/.bashrc or ~/.zshrc depending on which shell you're using.
#
GIT="command git"
# Detect shells (like zsh) that do not split variables into arguments