This file contains 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
// | |
// UICollectionView+ScrollViewAnimateable.swift | |
// persimmon | |
// | |
// Created by Keith Norman on 5/24/16. | |
// Copyright © 2016 Good Eggs. All rights reserved. | |
// | |
/// Based on https://github.com/plancalculus/MOScrollView. This allows animating contentOffset with a timing function. It's not possible to animate contentOffset via a CAAnimation. It is possible to animate bounds but then scrollview delegate methods don't get called which may be an issue if the animation exposes new cells in a table view or collection view and you expect those cells to render when the scroll into view. |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
void merge(int **a, int start, int end, int sz) { | |
int *a1 = a[start]; | |
int *a2 = a[end]; | |
int res[sz]; | |
int i = 0; | |
int j = 0; |
This file contains 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 TodoApp extends React.Component { | |
constructor({db}) { | |
super(); | |
this.db = db; | |
this.state = { | |
todos: [], | |
text: '', | |
} | |
} |
This file contains 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
//on the client | |
import Zango from 'zangodb'; | |
let db = new Zango.Db('todo_app', { todos: [] }); | |
ReactDOM.render( | |
<TodoApp db={db}/>, | |
document.getElementById('app') | |
); |
This file contains 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
// on the server | |
import { renderToStaticMarkup } from 'react-dom/server'; | |
import MongoClient from 'mongodb'; | |
app.get('*', (req, res) => { | |
var url = 'mongodb://localhost:27017/todo-app'; | |
MongoClient.connect(url, function(err, db) { | |
res.status(200).render('layout', { | |
locals: { | |
body: renderToStaticMarkup(<TodoApp db={db}/>), |
This file contains 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
<body> | |
<div id=’app’> | |
${body} | |
</div> | |
</body> |
This file contains 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 { renderToStaticMarkup } from 'react-dom/server'; | |
app.get('*', (req, res) => { | |
res.status(200).render('layout', { | |
locals: { | |
body: renderToStaticMarkup(<TodoApp/>), | |
} | |
}); | |
}); |
This file contains 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 Zango from 'zangodb'; | |
let db = new Zango.Db('todo_app', { todos: [] }); | |
class TodoApp extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
todos: [], |
This file contains 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
0x4db7a13ae9df91f427508e5b2253be851c3cbd14 |
This file contains 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
/** | |
* Copyright 2015 SmartThings | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | |
* in compliance with the License. You may obtain a copy of the License at: | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed | |
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License |
NewerOlder