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 main | |
| import ( | |
| "database/sql" | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "time" | |
| "github.com/go-sql-driver/mysql" |
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
| <?php | |
| // Example usage in a model: | |
| class ExampleModel extends Model | |
| { | |
| use HasUuid; | |
| protected $primaryKey = 'uuid'; |
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 { FieldProps } from 'formik' | |
| import React from 'react' | |
| import Select, { Option, ReactSelectProps } from 'react-select' | |
| export const SelectField: React.SFC<ReactSelectProps & FieldProps> = ({ | |
| options, | |
| field, | |
| form, | |
| }) => ( | |
| <Select |
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 to your layout/index.js | |
| */ | |
| import { PureComponent } from 'react' | |
| import { performScroll, scrollToHref } from '../../utils/helpers/scroll' | |
| const handleHashChange = () => { | |
| if (window.location.hash) { | |
| scrollToHref(window.location.hash) |
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
| let cache = new Map(); | |
| let pending = new Map(); | |
| function fetchTextSync(url) { | |
| if (cache.has(url)) { | |
| return cache.get(url); | |
| } | |
| if (pending.has(url)) { | |
| throw pending.get(url); | |
| } |
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 Reconciler from 'react-reconciler' | |
| import omit from 'lodash/omit' | |
| import capitalize from 'lodash/capitalize' | |
| import { actions as elementActions } from './store/elements' | |
| import * as Elements from './elements' | |
| const roots = new Map() | |
| const emptyObject = {} | |
| const Renderer = Reconciler({ |
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
| # FORGE CONFIG (DOT NOT REMOVE!) | |
| include forge-conf/redacted.com/before/*; | |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name redacted.com; | |
| root /home/forge/redacted.com; | |
| rewrite ^/submit*$ http://app.redacted.com/submit permanent; |
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
| IMAGE_CDN = https://apex-inc.imgix.net | |
| # Imgix image replacement. | |
| images: | |
| @echo "==> pointing images to $(IMAGE_CDN)" | |
| @find build -type f -name "*.html" | xargs sed -i '' 's|src="/images|src="$(IMAGE_CDN)/images|g' | |
| @find build -type f -name "*.html" | xargs sed -i '' 's|href="/images|href="$(IMAGE_CDN)/images|g' | |
| .PHONY: images |
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
| // In v2/3 you did this: | |
| import ReactDOM from 'react-dom' | |
| import { Router, browserHistory, Route } from 'react-router' | |
| ReactDOM.render( | |
| <Router> | |
| <Route path="/about" component={About}/> | |
| <Route path="/:username" component={User}/> | |
| </Router> | |
| ) |
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 replaces <Sequencer> + multiple <Sampler>s with a marble diagram sequencer. | |
| You can use it like this: | |
| <Marble | |
| resolution={16} | |
| samples={[ | |
| 'samples/kick.wav', | |
| 'samples/snare.wav', | |
| ]} |
NewerOlder