Skip to content

Instantly share code, notes, and snippets.

View cacheflow's full-sized avatar
🎯
Focusing

Lex cacheflow

🎯
Focusing
View GitHub Profile
module.exports = LRUCache
// This will be a proper iterable 'Map' in engines that support it,
// or a fakey-fake PseudoMap in older versions.
var Map = require('pseudomap')
var util = require('util')
// A linked list to keep track of recently-used-ness
var Yallist = require('yallist')
const errorCodes = require('./errorCodes');
const stringifyData = require('./stringifyData');
const handleError = (res) => {
let errMsg;
const options = {
showTwoFactorCode: false,
showVerifyCode: false,
status: 200,
}
'use strict'
class DoublyNode {
constructor(value) {
this.data = value;
this.previous = null
this.next = null
}
}

Keybase proof

I hereby claim:

  • I am cacheflow on github.
  • I am lexalexander (https://keybase.io/lexalexander) on keybase.
  • I have a public key ASCASIKX2tKy_xR_pWwmlli2cdROV_ejzVUUd05NiZFxmQo

To claim this, I am signing this object:

@cacheflow
cacheflow / .eslintrc
Created September 2, 2017 23:26 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
function getAuthor () {
let selectorsToCheck = ['span', 'a', 'link', 'p', ]
let foundElementsWithAuthorInThem = []
var obj = {}
while(selectorsToCheck.length != 0) {
let ele = Array.from($(selectorsToCheck.shift()))
let authorRegex = /(author|writer)/
ele.forEach((el, index) => {
let attrs = Object.keys(el.attributes)
for(var i = 0; i < attrs.length; i+=1) {
const scrapePackages = () => {
fs.readFile('./temp/username.txt', 'utf-8', (err, data) => {
if (err) throw err;
let username = data
let $;
let npmModuleUrl;
let $$;
let obj = {}
let packageName;
request(`https://www.npmjs.com/~${username}`, (err, res) => {
const fs = require('fs');
const ytdl = require('./lib/index');
ytdl('https://youtu.be/fxlbIS8CoW8')
.pipe(fs.createWriteStream('video.flv'));
'use strict'
var imgur = exports;
var request = require('request');
var Q = require('q');
var fs = require('fs');
var urlParser = require('url');
var glob = require('glob');
// The following client ID is tied to the
// registered 'node-imgur' app and is available
let converter = {
camelToSnake (data) {
return data.replace(/([A-Z])/g, (val) => "_" + val.toLowerCase())
},
snakeToCamel (data) {
return data.replace(/_([a-z])/g, function (g) { return g[1].toUpperCase(); });
}
}