Skip to content

Instantly share code, notes, and snippets.

View DrewDahlman's full-sized avatar

Drew Dahlman DrewDahlman

View GitHub Profile
class WebGLRenderer extends React.PureComponent {
static contextType = EffectContext;
constructor(props) {
super(props);
this.scene = new Scene();
}
componentDidMount() {
// Initialize the scene
class ImageBlock extends React.PureComponent {
state = {
loaded: false
};
componentDidMount() {
this.ref.addEventListener("load", this.onLoad);
}
onLoad = () => {
const App = () => {
return (
<WebGL>
<Headline />
<ComponentOne />
<WebGLElement type={`image`} data={data} />
<WebGLElement type={`image`} data={data} />
<ComponentTwo />
</WebGL>
);
class WebGLElement extends React.PureComponent {
// Switch to check the type:
// this could be expanded to include other elements
getComponent(contextValues, props) {
switch (props.type) {
case "image":
return <ImageBlock {...contextValues} {...props} />;
break;
case "example-image":
return <ExampleImage {...contextValues} {...props} />;
const App = () => {
return (
<WebGL>
<Headline />
<ComponentOne />
<Image />
<Image />
<ComponentTwo />
</WebGL>
);
class WebGL extends React.Component {
state = {
elements: [],
renderer: null,
scene: null
};
addImage = (image) => {
//.. Create Image texture & push into webgl context
}
.no-focus-outline:focus {
outline: none;
}
@DrewDahlman
DrewDahlman / staging.rb
Last active June 18, 2019 21:50
Staging.rb modified
# Simple Role Syntax
# ==================
role :app, %w{www-data@159.89.38.13} ## Your IP
set :branch, "staging"
set :deploy_to, "/var/www/#{fetch(:application)}/staging"
@DrewDahlman
DrewDahlman / deploy.rb
Last active May 5, 2019 21:33
Deploy.rb condfigured
set :application, "wordpress-workflow"
set :repo_url, "git@github.com:DrewDahlman/wordpress-workflow.git"
set :user, 'www-data'
# Default value for :scm is :git
set :scm, :git
# Default value for :format is :pretty
set :format, :pretty
@DrewDahlman
DrewDahlman / deploy.rb
Created May 5, 2019 21:05
capistrano init file
set :application, "my_app_name"
set :repo_url, "git@example.com:me/my_repo.git"
# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
# Default deploy_to directory is /var/www/my_app_name
# set :deploy_to, "/var/www/my_app_name"
# Default value for :format is :airbrussh.