Skip to content

Instantly share code, notes, and snippets.

View wmertens's full-sized avatar

Wout Mertens wmertens

View GitHub Profile
@kirbysayshi
kirbysayshi / mdb.js
Created September 12, 2011 19:36
example showing how to wrap node-mongodb-native driver in promises. uses jquery deferreds from https://github.com/kirbysayshi/jquery-jqd
var mongo = require('mongodb')
,jqd = require('../jquery-jqd').jqd
,host = process.env['MONGO_NODE_DRIVER_HOST'] != null
? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost'
,port = process.env['MONGO_NODE_DRIVER_PORT'] != null
? process.env['MONGO_NODE_DRIVER_PORT'] : mongo.Connection.DEFAULT_PORT
,db = null
,gConnection = null;
@rastating
rastating / USNetflixHosts
Created November 27, 2013 22:04
A hosts file to use to access the US Netflix using the Unblock US service without using their DNS for all of your traffic.
# Hosts file to access US Netflix using Unblock US without their DNS.
67.216.222.61 movies.netflix.com
67.216.222.65 cbp-us.nccp.netflix.com
67.216.222.130 movies1.netflix.com
67.216.222.104 movies2.netflix.com
147.255.171.14 netflix.com
147.255.171.7 moviecontrol.netflix.com
69.197.181.166 api-global.netflix.com
67.216.222.83 api-us.netflix.com
147.255.227.2 api.netflix.com
@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;
@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>
@MrOrz
MrOrz / README.md
Last active July 22, 2018 15:36
Cross-device BrowserSync with webpack demo
@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]
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.
@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.

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

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