Skip to content

Instantly share code, notes, and snippets.

Avatar
Writing code

Cory Reed swashcap

Writing code
View GitHub Profile
@swashcap
swashcap / mkdirtouch.js
Created Jan 20, 2017
`mkdir -p` and `touch` rolled in one
View mkdirtouch.js
var path = require('path')
var mkdirp = require('mkdirp')
var touch = require('touch')
var file = process.argv[2]
function cb(error) {
if (error) {
console.error(error)
} else {
@swashcap
swashcap / toggle-header.js
Created Feb 10, 2017
GitHub Header Toggler
View toggle-header.js
// Original:
(function(doc, className) {
var header = doc.querySelector('[role=banner]'),
button = doc.createElement('button'),
classList = header.classList,
light = className + 'light',
dark = className + 'dark',
isLight
button.className = 'btn'
button.style = 'position:sticky;bottom:1em;left:1em'
View crazy-github-suggestions.js
(function () {
'use strict'
function getLi(username, name) {
var li = document.createElement('li'),
small = document.createElement('small')
small.textContent = name
li.className = 'js-navigation-item'
li.setAttribute('data-mentionable-type', 'user')
View freesurfer-validate.js
'use strict';
var _ = require('lodash');
var FreeSurfer = require('freesurfer-parser');
var path = require('path');
var os = require('os');
var fs = require('fs');
var glob = require('glob')
var mkdirp = require('mkdirp');
var pify = require('pify');
View data.json
{
"users": [
{
"birthday": 1480634264530,
"email": "Kira.Rosenbaum83@hotmail.com",
"favoriteColor": "indigo",
"id": "43aa36bb-7c93-4651-a317-1af1b4879856",
"image": "https://s3.amazonaws.com/uifaces/faces/twitter/mrjamesnoble/128.jpg",
"joinDate": 1480634264531,
"name": "Mandy Schowalter",
@swashcap
swashcap / models-error-test.js
Created Apr 25, 2017
Testing error sanitization
View models-error-test.js
'use strict';
const assert = require('assert');
class ModelsError extends Error {
constructor(message, file, fileType) {
super(message);
this.name = 'ModelsError';
this.file = file;
View bonk-sp-test-output.txt
~/Sites/quarterback/packages/steelpenny$ npm t
> steelpenny@5.3.2 test /Users/creed/Sites/quarterback/packages/steelpenny
> nyc mocha 'test/{integration,unit}/*.js'
Running with COINS_ENV: development
Using default dbmap.json
(node:2687) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
View e40e0441b2fcc1389efb3edb7729f575cd0ce4af-log.txt
> coinstac@2.0.0 lint /home/rof/src/github.com/MRN-Code/coinstac
> eslint '**/*.js' '**/bin/*'
> coinstac@2.0.0 test /home/rof/src/github.com/MRN-Code/coinstac
> lerna run test --concurrency=1
Lerna v2.0.0-beta.32
> coinstac-client-core@2.5.0 test /home/rof/src/github.com/MRN-Code/coinstac/packages/coinstac-client-core
View chokidar-test-3d917818c957088b62c160e426c1a99787ae6319.txt
$ npm t
> chokidar@1.7.0 test /Users/creed/Sites/chokidar
> istanbul test node_modules/mocha/bin/_mocha
chokidar
✓ should expose public API methods
fsevents (native extension)
View 2017-09-21T21_12_45_694Z-debug.log
24012 silly extract websocket-extensions@0.1.2
24013 silly extract yargs-parser@7.0.0
24014 silly extract which-module@2.0.0
24015 silly extract webpack-sources@1.0.1
24016 silly extract read-pkg-up@2.0.0
24017 silly extract read-pkg@2.0.0
24018 silly extract load-json-file@2.0.0
24019 silly extract strip-bom@3.0.0
24020 silly extract string-width@2.1.1
24021 silly extract strip-ansi@4.0.0
You can’t perform that action at this time.