Skip to content

Instantly share code, notes, and snippets.

View ctavan's full-sized avatar

Christoph Tavan ctavan

View GitHub Profile
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 / 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));
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.

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:

@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
@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 / 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/>