Skip to content

Instantly share code, notes, and snippets.

@thehesiod
thehesiod / freeze_time.sql
Created May 20, 2020 09:41
fake/mock now on postgres DB
-- inspiration from https://dba.stackexchange.com/questions/69988/how-can-i-fake-inet-client-addr-for-unit-tests-in-postgresql/70009#70009
CREATE SCHEMA if not exists override;
create table if not exists override.freeze_time_param_type
(
param_type text not null primary key
);
insert into override.freeze_time_param_type values ('enabled'), ('timestamp'), ('tick') on conflict do nothing;
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');