-
Create a data source and export it as a JNDI service.
Java:
@Component(service=javax.sql.DataSource.class, property="osgi.jndi.service.name=jdbc/myDataSource") public class MyDataSource extends SomeDbVendorDataSourceImpl implements javax.sql.DataSource { // ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>bacon.js and baconjs-router POC</title> | |
<script src="https://unpkg.com/[email protected]/babel.min.js"></script> | |
<script src="https://unpkg.com/react@latest/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@latest/dist/react-dom.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.95/Bacon.js"></script> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Bacon from 'baconjs'; | |
/** | |
* Create a factory of higher order components that render the specified inner | |
* component using the specified mapping of property names to the streams that | |
* feed them values and the specified mapping of callback property names to | |
* the buses onto which the callbacks' first parameter is pushed when called. | |
* | |
* This is similar in concept to react-redux's connect() function, but for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React + Bacon.js + Page.js</title> | |
<script src="https://unpkg.com/[email protected]/babel.min.js"></script> | |
<script src="https://unpkg.com/react@latest/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@latest/dist/react-dom.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.95/Bacon.min.js"></script> | |
<script src="https://cdn.rawgit.com/visionmedia/page.js/master/page.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>bacon.js and baconjs-router POC</title> | |
<script src="https://unpkg.com/[email protected]/babel.min.js"></script> | |
<script src="https://unpkg.com/react@latest/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@latest/dist/react-dom.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.95/Bacon.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* <p>Create a function that can generate BEM classes based on the specified block.</p> | |
* <p>Suppose you have the following code:</p> | |
* <pre> | |
* const bem = bemFor('my-block'); | |
* </pre> | |
* Then: | |
* <ul> | |
* <li><code>bem()</code> will return <code>"my-block"</code></li> | |
* <li><code>bem('my-element')</code> will return <code>"my-block__my-element"</code></li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyComponent extends React.Component { | |
static propTypes = { | |
photoUrl: PropTypes.string, | |
initialButtonVisible: PropTypes.bool | |
}; | |
static defaultProps = { | |
photoUrl: '', | |
initialButtonVisible: true | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyComponent extends React.Component { | |
constructor(props) { | |
this.state = { | |
photoVisible: this.props.initialPhotoVisible | |
}; | |
this.togglePhotoVisible = this.togglePhotoVisible.bind(this); | |
} | |
togglePhotoVisible() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table budget_category | |
( | |
id bigserial, | |
name text not null, | |
constraint pk_budget_category primary key (id) | |
); | |
create table financial_source | |
( | |
id bigserial, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with | |
a as (select * from generate_series(0, 6) s), -- 6 is user specified number of days - 1 | |
b as (select ('2013-03-01'::date + s * interval '1 day')::date appt_date from a), -- 2013-03-01 is user specified start date | |
c as (select * from generate_series('2013-03-02 00:00'::timestamp without time zone, '2013-03-05 23:59'::timestamp without time zone, '10 minutes') appt), -- Dummy data - appointment times | |
d as (select appt::date appt_date, to_char(appt, 'HH24:MI') appt_time from c), -- Split out the date and time | |
e as (select appt_date, json_agg(appt_time order by appt_time) times from d group by appt_date), -- Aggregate times into an array per day | |
f as (select appt_date, coalesce(times, '[]'::json) times from b left join e using (appt_date)) -- Left join onto the generated date series to produce an array for all days including empty ones | |
select json_agg(times order by appt_date) from f -- Aggregate the result into a single array of arrays |