Skip to content

Instantly share code, notes, and snippets.

View nexdrew's full-sized avatar

Andrew Goode nexdrew

View GitHub Profile
@nexdrew
nexdrew / cp-jboss-maven-src.groovy
Last active August 29, 2015 13:56
Extracts "sources.jar" files from a local JBoss Maven Repo distribution and copies them to their respective module in a local JBoss EAP/AS distribution
import java.nio.file.attribute.BasicFileAttributes
import java.nio.file.*
//-- first validate args
def exit = { code, msg ->
println msg
System.exit(code)
}
if(args.length != 2) {
@nexdrew
nexdrew / MariaDB.repo
Created May 21, 2015 19:57
Example yum repo for MariaDB 10.0
# MariaDB 10.0 CentOS repository list - created 2015-05-21 19:53 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
@nexdrew
nexdrew / keybase.md
Created November 9, 2015 14:15
Keybase Proof

Keybase proof

I hereby claim:

  • I am nexdrew on github.
  • I am nexdrew (https://keybase.io/nexdrew) on keybase.
  • I have a public key whose fingerprint is 68F4 6877 E63F 6430 D21B C519 CFBB 5A37 C444 E238

To claim this, I am signing this object:

@nexdrew
nexdrew / nexdrew-new-human.md
Last active November 9, 2015 17:20
humans++

The humans are multiplying!

This week finds a new human working at npm, Inc. Its name is Andrew Goode, an engineer who previously hacked for 8 years in the telematics industry. Haven't heard of him? Yeah, we haven't either. But he comes highly recommended and will be doing his best to make the npm On-Site product as goode as it can be. (See what we did there?) Andrew is based in Atlanta and kinda looks like this:

yes this is his real face

You can find him at local Node meetups or on GitHub and Twitter as nexdrew.

@nexdrew
nexdrew / TransactionAwareSessionContext.java
Last active December 25, 2015 14:39 — forked from seykron/TransactionAwareSessionContext.java
Modified fork of seykron's original workaround for SPR-9020. See comments for more details.
import java.util.Arrays;
import org.hibernate.FlushMode;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.context.TenantIdentifierMismatchException;
import org.hibernate.context.internal.ManagedSessionContext;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.service.jta.platform.spi.JtaPlatform;
import org.slf4j.Logger;
@nexdrew
nexdrew / yargs-4.x-breaking-changes.md
Created January 12, 2016 13:27
How to upgrade from yargs 3 to yargs 4

4.x Breaking Changes

  • PR #330: .version() method now expects the version argument to be last instead of first.

Upgrade: change .version('1.0.0', 'v', 'Print app version') to .version('v', 'Print app version', '1.0.0')

@nexdrew
nexdrew / what-makes-open-source-work.md
Last active January 13, 2016 19:09
Ideas that could be organized into a talk/prez

What Makes OSS Work

GH, npm, Travis, Coveralls

Source code that is... "open"

  • Find/view source code (GitHub website)
  • Duplicate/download source code (git clone)
  • Sandbox/isolate changes (git checkout -b)
  • Capture changes (git add && git commit)

Node philosophy = Unix philosophy

  • many small modules
  • each module does one thing and does it well
  • think lego bricks
  • why is this good for open source?
    • smaller surface area
    • easier to test
    • easier to understand
    • easier to contribute

Size comparison of popular CLI modules

Inspired by yargs issue 468.

Here are the numbers by my count, using Node 5.9.1 and npm 3.8.5 on OS X 10.11.4:

yargs@4.4.0
  • 49 dependencies
  • 64 total directories

Problematic Dependencies

When using npm Enterprise, we sometimes encounter public packages in our private registry that need to fetch resources from the public internet when being installed by a client via npm install.

Unfortunately, this poses a problem for developers who work in an environment with limited or no access to the public internet.

In this article, we're going to look at some of the more common types of problems in this area and talk about ways we can work around them.

Note that these problems are not specific to npm Enterprise as a product, but are specific to using certain public packages in a limited-access environment. That being said, there are some things that npm (as an organization and software vendor) can do to better prevent or handle some of these problems, and we will be working towards that goal in the near future.