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 * as http from "http"; | |
| interface Handler<T extends http.IncomingMessage> { | |
| (req: T, res: http.ServerResponse): any; | |
| } | |
| type WithDB = {db: number}; | |
| function withPg<T extends http.IncomingMessage>(handler: Handler<T & WithDB>): Handler<T> { | |
| return (req, res) => { | |
| const newReq = req as T & WithDB; |
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 B from "glamorous"; | |
| import {Link} from "react-router-dom"; | |
| import col from "./colors"; | |
| const FullHeight = B.div({ | |
| display: "flex", | |
| flexDirection: "column", | |
| flex: "auto", | |
| minWidth: 0, |
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 ResizeObserver from "resize-observer-polyfill"; | |
| import shallowEqual from "fbjs/lib/shallowEqual"; | |
| export default class PausableMeasure extends React.Component { | |
| node = null; | |
| state = {bounds: null}; | |
| componentWillMount() { | |
| if (!this.props.dontMeasure) this.setup(); |
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
| const routes = [ | |
| {label: "Home", url: "/"}, | |
| {label: "Sub Page", url: "/sub"} | |
| ]; | |
| const TabsElement = () => ( | |
| <Tabs value="match">{routes.map(({label, url}) => ( | |
| <Route path={url} exact>{({match}) => ( | |
| <Tab label={label} value={match && "match"} containerElement={p => <Link {...p} to={url}/>}/> | |
| )}</Route> |
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
| ` | |
| this allows you to use all of webpack's goodness to load your sprites. | |
| here's some benefits: | |
| - saving one roundtrip since webpack's json-loader will inline the json data into the script. Thus it doesn't need to be loaded from the server first | |
| - use a lot of the file-loader power and beyond to create cache-busting urls, and apply image-minification via e.g. image-webpack-loader | |
| ` | |
| import PIXI from "pixi.js"; |
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
| require 'slack-notifier' | |
| slack_notifier = Slack::Notifier.new HOOKURL, username: 'oh-noes' | |
| rescue_from :all do |e| | |
| attachment = { | |
| fallback: "stacktrace", | |
| color: "danger", | |
| fields: e.backtrace.map {|line| {value: slack_notifier.escape(line), short: false}} | |
| } |
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
| // By including either of those libraries the minified code size will increase by... | |
| var request = require("superagent"); // 9.05 kB | |
| var request = require("qwest"); // 7.8 kB | |
| var request = require("rest"); // 28.8 kB | |
| var request = require("browser-request"); // 6.37 kB | |
| var request = require("reqwest"); // 10.1 kB |
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
| public abstract class CrudController<T extends Model> { | |
| protected Form<T> form; | |
| private Template1<Form<T>,Html> composeTemplate; | |
| private Template1<T,Html> showTemplate; | |
| private Template2<T,Form<T>,Html> editTemplate; | |
| private Template1<List<T>,Html> listTemplate; | |
| private Finder<Long,T> finder; | |
| public CrudController(Class<T> clazz, |
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
| package controllers; | |
| import models.Model; | |
| import models.User; | |
| import play.api.templates.Html; | |
| import play.data.Form; | |
| import play.mvc.Controller; | |
| import play.mvc.Result; | |
| public abstract class ControllerAgent<T extends Model, F1, F2> { |
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
| 18:28:24 xuggler_repo(master|✔) % ant ivy-retrieve | |
| Buildfile: /opt/xuggler_repo/build.xml | |
| ivy-init: | |
| [echo] Initing ivy from /opt/xuggler_repo/mk/buildtools/lib/ivy-2.2.0.jar | |
| [echo] Ivy task loaded: /opt/xuggler_repo/mk/buildtools/lib/ivy-2.2.0.jar | |
| [echo] Ivy settings file set: /opt/xuggler_repo/mk/buildtools/ivysettings.xml | |
| ivy-retrieve: | |
| [mkdir] Created dir: /opt/xuggler_repo/build/lib |