Skip to content

Instantly share code, notes, and snippets.

View program247365's full-sized avatar
💭
YOLO 💯

Kevin Ridgway program247365

💭
YOLO 💯
View GitHub Profile
@bcoe
bcoe / npm-top.md
Last active March 21, 2025 03:49
npm-top.md

npm Users By Downloads (git.io/npm-top)


npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.

Metrics are calculated using top-npm-users.

# User Downloads
@nepsilon
nepsilon / how-to-app-siege-load-test.md
Last active February 19, 2017 12:45
How to test your webapp for heavy traffic? — First published in fullweb.io issue #24

How to test your web app for heavy traffic?

Load testing is a good way to understand your website or web app behaviour under high traffic. Here is how to use siege, a simple CLI tool.

Note: Use siege only on sites you own as its traffic could be interpreted as a DDOS attack.

Using 100 concurrent requests and up to 3 seconds between requests:

@celoyd
celoyd / hi8-anim-howto.md
Last active August 1, 2022 15:37
A way to make Himawari-8 animations

Himawari-8 animation tutorial

Here’s how to make animations like this one. It requires intermediate Unix command-line knowledge, to install some tools and to debug if they don’t work. You’ll need these utilities:

  • curl (or you can translate to wget)
  • convert and montage, part of ImageMagick
  • ffmpeg, plus whatever codecs
  • parallel, for iteration that’s nicer than shell for loops or xargs
  • run everything in zsh for leading 0s in numerical ranges to work
@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
@tiarno
tiarno / iframe_vis.js
Last active January 29, 2020 08:41
javascript: is element inside an iframe visible within the viewport?
// Given an iframe id and an anchor id that is present within the iframe,
// determine whether the element is visible/present inside the window viewport.
// This is not about the css 'display' property; this shows whether
// the window viewport contains the element.
var isVisible = function (anchor, iframe_id) {
var ifrId = iframe_id || 'bv_page';
var ifrOffset = window.parent.document.getElementById(ifrId).offsetTop;
var myloc = document.getElementById(anchor).offsetTop + ifrOffset;
var viewtop = window.parent.scrollY;
@jeffwhelpley
jeffwhelpley / gist:056e012544c631438ad2
Created July 12, 2015 02:06
playing nice: continuation-local-storage, hapi.js and pm2

I had a lot of issues trying to get continuation-local-storage (cls) working on a hapi.js app with pm2 in cluster_mode. Long story short, my mistake was wrapping cls around my server.start() when I should have been running it in a request handler. Here is the code you should use to get all this working:

var cls = require('continuation-local-storage');
var ns = cls.createNamespace('mySession');

var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
@xjamundx
xjamundx / blog-webpack-2.md
Last active November 7, 2024 13:10
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

/**
* var jpr = new JSONPRequest();
* jpr.onload = (...data) => {
* console.log(data);
* };
* jpr.open('GET', 'some-url?callback={{callback}}');
* jpr.send();
*/
@developit
developit / es-component.js
Created June 17, 2015 20:01
React ES6 Components
import React from 'react';
export class Component extends React.Component {
constructor(...args) {
super(...args);
this.generateBindings();
if (typeof this.init==='function') {
this.init();
}
}
@developit
developit / set-immediate.js
Last active August 29, 2015 14:23
setImmediate multiple implementations
var setImmediate = (function(f, q, p, reg) {
q = [];
f = document.createElement('iframe');
f.style.cssText = 'position:absolute;top:-999em;left:0;width:1px;height:1px;';
document.body.appendChild(f);
function done() {
for (var i=0; i<q.length; i++) q[i]();
q.length = 0;
}
p = [