Skip to content

Instantly share code, notes, and snippets.

View CodeLenny's full-sized avatar

CodeLenny CodeLenny

  • Massachusetts
View GitHub Profile
@CodeLenny
CodeLenny / HeadyFoods.coffee
Last active August 29, 2015 14:10
HeadyFoods Draft
class HeadyFoods
constructor: ->
@blade = require("node-blade")
# Add database connection
@mongoose = require("mongoose")
@Schema = @mongoose.Schema
@db = @mongoose.connect "mongodb://#{@config.db.host}:#{@config.db.port}/#{@config.db.database}"
@db.once "open", =>
@FoodItem = @createFoodItem()
@configureExpress()
@CodeLenny
CodeLenny / README.md
Last active January 3, 2016 17:48 — forked from Daniel15/1_README.md
Complete Google Drive File Picker example

Google Drive File Picker Example

This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.

Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.

See a demo at http://stuff.dan.cx/js/filepicker/google/

@CodeLenny
CodeLenny / styler.meta.js
Last active August 31, 2016 20:04
GitLab Link Styler
// ==UserScript==
// @name GitLab Link Styler
// @namespace http://ryanleonard.us/
// @version 0.1
// @description Style closed issues and merge requests on GitLab
// @author Ryan Leonard
// @match http*://gitlab.com/*
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue

Keybase proof

I hereby claim:

  • I am codelenny on github.
  • I am codelenny (https://keybase.io/codelenny) on keybase.
  • I have a public key ASCNDhBbNEXs76GUdb2Pz6y7Q1TflbkkWeotSuIjW3oi_Qo

To claim this, I am signing this object:

###
Created for http://stackoverflow.com/questions/34982953/child-process-stream-backpressure
Please pardon the CoffeeScript, but I couldn't stand to extend stream.Transform in native JavaScript.
###
fs = require("fs")
execStream = require("exec-stream")
brake = require("brake")
file = fs.createWriteStream("tmp.txt")
@CodeLenny
CodeLenny / deep-reference.json
Last active March 16, 2017 19:50
REST API Endpoint
{
"document": {
"$ref": "document.json"
},
"value": {
"$ref": "document.json#bar/baz"
}
}
@CodeLenny
CodeLenny / README.md
Created May 28, 2017 22:32
National Park List
let x = new Error("Test");
Promise
.resolve(x)
.then(() => console.log("Good"))
.catch() => console.log("Bad"));
// => "Bad"
@CodeLenny
CodeLenny / AVA Tips.adoc
Last active June 27, 2017 20:03
AVA Tips

AVA Tips and Hacks

(None of this is official, and some of it should be very carefully used)

Tips

Hide a Test

@CodeLenny
CodeLenny / index.html
Created August 8, 2017 14:47 — forked from anonymous/index.html
Mocha Testing via PolyGit Browser testing with Mocha and Chai loaded through PolyGit // source https://jsbin.com/felaqoq
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta name="description" content="Browser testing with Mocha and Chai loaded through PolyGit">
<title>Mocha Testing via PolyGit</title>
</head>
<body>
<script src="https://polygit2.appspot.com/components/webcomponentsjs/webcomponents-lite.js"></script>