Skip to content

Instantly share code, notes, and snippets.

View harriha's full-sized avatar

Harri Hälikkä harriha

  • Futurice
  • Helsinki, Finland
View GitHub Profile
@phadej
phadej / eslint-all-rules.js
Created August 21, 2015 09:40
ESLint all rules as by 2015-08-21
{ rules: {
// Generated using magic regex:
// from: ^([a-z-]+) - (.*)$
// to: // \2: http://eslint.org/docs/rules/\1\n \1: 2,\n
//
// Use http://oleg.fi/relaxed-json/ to convert to plain json
// Possible Errors
// disallow or enforce trailing commas (recommended): http://eslint.org/docs/rules/comma-dangle
comma-dangle: 2,
@inindev
inindev / postgresql_jsonb_crud.sql
Last active February 13, 2024 03:18 — forked from matheusoliveira/json_manipulator.sql
Simple PostgreSQL 9.4 functions to manipulate jsonb objects adapted from Matheus de Oliveira's json_manipulator.sql. https://gist.github.com/matheusoliveira/9488951 (Note: performance is not a concern for those functions)
/*
* derivative work of Matheus de Oliveira's json_manipulator.sql
* https://gist.github.com/matheusoliveira/9488951
*
* adapted to support postgresql 9.4 jsonb type
* no warranties or guarantees of any kind are implied or offered
*
* license is as Matheus conferred it on 4/9/2015:
* matheusoliveira commented on Apr 9
* @hannes-landeholm, I'd like to take credit if you share them
@klamping
klamping / notes.md
Last active November 1, 2017 18:00
Visual Regression Testing Resources
@paulirish
paulirish / bling.js
Last active May 10, 2025 11:02
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
@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
@prestonparris
prestonparris / reactjs-conf-2015-notes.md
Last active April 6, 2017 21:32
Notes from the 2015 React.js Conference

Reactjs conf 2015 Notes

  • react native announced

    • Allows you to use react style javascript to target native ios and android, native views, live reloading
    • intro pt1
    • intro pt2
    • facebook groups app uses react native with graphql and relay
  • realtime page tweaking

    • rethink best practices and workflows
  • inmutability is a good idea

@ericelliott
ericelliott / essential-javascript-links.md
Last active March 22, 2025 17:28
Essential JavaScript Links
'use strict';
var env = process.env.NODE_ENV || 'development';
var gulp = require( 'gulp' );
var path = require( 'path' );
var $ = require( 'gulp-load-plugins' )();
gulp.task( 'tsc' , function (){
return gulp.src( [ './app/src/build.ts' ] )
.pipe( $.tsc( {
@lucdew
lucdew / json_postgres.js
Last active April 12, 2025 09:09
Example of json document storage in postgresql and querying (with knex.js)
var connectionString = 'postgres://localhost:5432/postgres';
var Promise=require('bluebird');
var knex = require('knex')({
client: 'pg',
connection: {
user: 'postgres',
database: 'postgres',
port: 5432,
@staltz
staltz / introrx.md
Last active May 12, 2025 23:22
The introduction to Reactive Programming you've been missing