Skip to content

Instantly share code, notes, and snippets.

View ArnaudRinquin's full-sized avatar
🦆
rubber ducking

Arnaud Rinquin ArnaudRinquin

🦆
rubber ducking
View GitHub Profile
@guncha
guncha / readme.md
Created December 10, 2015 20:08
Jasmine HTMLReporter stack traces using source maps

To get a quick and dirty stack traces with Jasmine's HTML Reporter, add this on the spec runner page after jasmine/boot.js.

<script type="text/javascript" src="sourcemapped-stacktrace.js"></script>
<script type="text/javascript">
  jasmine.getEnv().addReporter({
    jasmineDone: function() {
      var traces = document.querySelectorAll(".jasmine-stack-trace")
      for(var i = 0; i < traces.length; i++) {
 (function(node){
@imjasonh
imjasonh / markdown.css
Last active May 24, 2024 22:56
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@iampeter
iampeter / gist:5af9c9e113e41c954364
Last active April 14, 2020 13:00
Simple proxy with hapi.js to fix your CORS problems

Problem

While building a JavaScript single page app that acts as a front-end to multiple backend servers, even if they are on the same host as the web app - but on different ports, you come across CORS issues.

Solution

Use a simple node.js + hapi.js server to:

  1. Serve your static single page app
  2. Act as proxy to the backend servers
@ericelliott
ericelliott / essential-javascript-links.md
Last active July 18, 2024 15:03
Essential JavaScript Links
@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@afair
afair / gist:3803895
Last active August 7, 2023 07:43
PostgreSQL and Pgpool Architecture

Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer

Thanks for stopping by!

PostgreSQL and Pgpool Architecture