This Gist was automatically created by Carbide, a free online programming environment.
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 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
Save New Duplicate & Edit Just Text Twitter | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 |
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 './Resizable.scss'; | |
import * as React from 'react'; | |
import { clamp } from 'lodash'; | |
export class Resizable extends React.Component { | |
state = { | |
width: this.props.defaultWidth | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
renderCanvas () { | |
const {ctx, img, offset, zoom} = this.state; | |
const {width, height} = this.props; | |
const cappedZoom = Math.max(1, zoom); | |
const imgSize = Math.min(img.width, img.height); | |
const left = (img.width - imgSize) / 2; | |
const top = (img.height - imgSize) / 2; | |
let hMovement = (-(cappedZoom - 1) * height) - offset.x; |
This Gist was automatically created by Carbide, a free online programming environment.
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 server | |
import ( | |
"errors" | |
"github.com/ell/tunes/mopidy" | |
"golang.org/x/net/context" | |
"log" | |
"net/http" | |
) |
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 server | |
import ( | |
"encoding/json" | |
"golang.org/x/net/context" | |
"net/http" | |
) | |
// ContextHandler interface wrapper for ServeHTTPContext | |
type ContextHandler interface { |
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
router.Handle("/add", &ContextAdapter{ | |
ctx: rootContext, | |
handler: withAPIKeyAuthentication(cfg.Server.APIKey, withDatabase(db, withMopidyClient(mclient, ContextHandlerFunc(addSongHandler)))), | |
}).Methods("POST") |
NewerOlder