Skip to content

Instantly share code, notes, and snippets.

View wmertens's full-sized avatar

Wout Mertens wmertens

View GitHub Profile
@wmertens
wmertens / New iTerm Window.scpt
Last active February 2, 2017 21:48
Open a new iTerm window (https://iterm2.com) in the current application folder via Applescript
on run
-- Figure out if we want to do the cd (doIt)
-- Figure out what the path is and quote it (myPath)
set doIt to false
try
tell application "Finder" to set doIt to frontmost
set myPath to finder_path()
if myPath is equal to "" then
set doIt to false
else
@voodooattack
voodooattack / gql-directives.js
Last active January 5, 2020 09:57
GraphQL-Sequelize auto-model functionality. Directly translates the schema language into database models via directives.
const { parse, visit, print, Kind, BREAK } = require('graphql/language');
const { buildASTSchema } = require('graphql/utilities');
const { addResolveFunctionsToSchema } = require('graphql-tools');
const Sequelize = require('sequelize');
const { graphql } = require('graphql');
const jexl = require('jexl');
const deepAssign = require('deep-assign');
const { resolver: sequelizeResolver } = require('graphql-sequelize');
const { inspect } = require('util');
// Based on https://gist.github.com/langpavel/b30f3d507a47713b0c6e89016e4e9eb7
const serializeDate = value => {
if (value instanceof Date) {
return value.toJSON().slice(0, 10)
} else if (typeof value === 'number') {
return Math.trunc(value)
} else if (typeof value === 'string') {
return (new Date(value)).toJSON().slice(0, 10)
}
return null
@ryyppy
ryyppy / proposal.md
Last active May 20, 2023 02:07
A Life on a Commandline - How to never touch a mouse again. Lightning Talk Proposal for ReactiveConf 2016 (https://reactiveconf.com/)

Proposal for this year's Reactive lightning talks @ReactiveConf - If you want to see my talk, star this gist please :-) [Reactive Blogpost][reactive-conference-blogpost]


A life on a Commandline

As a JavaScript developer, could you imagine using something else than Atom, Sublime or other IDE-like text-editors? During their daily work, people wrangle a lot with different applications, editors, windows, browsers and loose a lot of time because of their tools getting in their way.

@edolstra
edolstra / nix-ui.md
Last active February 2, 2024 23:31
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.

Thank you for extending an invitation to speak at HighLoad++. I
sincerely appreciate your consideration.
I am an outspoken advocate for LGBTQ equality; this position is deeply
woven into my work. Clojure From The Ground Up is adamantly
LGBT-inclusive. Jepsen is named after a gay pop anthem and includes
dozens of references to same-sex relationships and trans identities. My
talk slides are populated with bearded nuns, genderqueer punks, and
trans hackers. My twitter feed is about as gay as it is possible to get.
@wmertens
wmertens / auto-vendor-prefixer.coffee
Last active August 29, 2015 14:18
tiny in-browser memoized auto-prefixer for React styles, supports flexbox too.
# Auto-vendor-prefixer
# Finds the vendor prefix to use
# MIT license, Author: Wout Mertens
prefix=null
myStyle=document?.head?.style or {}
foundProps={}
newCssProp = (prop) ->
t = foundProps[prop]
@MrOrz
MrOrz / README.md
Last active July 22, 2018 15:36
Cross-device BrowserSync with webpack demo
@wmertens
wmertens / private.xml
Last active March 12, 2019 19:57
Use Karabiner (https://pqrs.org/osx/karabiner/) to emulate a http://waytools.com TextBlade as well as add some useful shortcuts for the TextBlade proper.
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>WT</vendorname>
<vendorid>0x000d</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>TB</productname>
<productid>0x0000</productid>
@MoOx
MoOx / svgicon.css
Last active December 3, 2018 08:50
Svg icons with React.js with webpack loader (svg: raw-loader)
.SVGIcon {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* fix webkit/blink poor rendering issues */
transform: translate3d(0,0,0);
/* it's better defined directly because of the cascade shit
width: inherit;
height: inherit;