Skip to content

Instantly share code, notes, and snippets.

🏳️‍🌈

Patrick Curry pwfcurry

🏳️‍🌈
Block or report user

Report or block pwfcurry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@constgen
constgen / .travis.yml
Last active Jun 24, 2019
Travis NPM publishing
View .travis.yml
language: node_js
node_js:
- "8"
install:
- npm install
cache:
directories:
- node_modules
script:
- npm test
@shihanng
shihanng / .chunkwmrc
Last active Jul 1, 2019
chunkwm + skhd
View .chunkwmrc
#!/bin/bash
#
# NOTE: specify the absolutepath to the directory to use when
# loading a plugin. '~' expansion is supported.
#
chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins
#
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active Jul 18, 2019
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@branneman
branneman / better-nodejs-require-paths.md
Last active Jul 17, 2019
Better local require() paths for Node.js
View better-nodejs-require-paths.md

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@mandubian
mandubian / gist:5183939
Created Mar 17, 2013
Play2.1 JSON API: Reads a JsArray and then map on its elements applying Reads (cumulating errors)
View gist:5183939
// maybe we could add this one into Play...
// Reads a JsArray and then map on its elements applying Reads (cumulating errors)
def readJsArrayMap[A <: JsValue](transformEach: Reads[A]): Reads[JsArray] = Reads { js => js match {
case arr: JsArray =>
arr.value.foldLeft(JsSuccess(Seq[JsValue]()): JsResult[Seq[JsValue]]) { (acc, e) =>
acc.flatMap{ seq =>
e.transform(transformEach).map( v => seq :+ v )
}
}.map(JsArray(_))
case _ => JsError("expected JsArray")
You can’t perform that action at this time.