Skip to content

Instantly share code, notes, and snippets.

Avatar

E.D.M. duggiemitchell

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am duggiemitchell on github.
  • I am duggiemitchell (https://keybase.io/duggiemitchell) on keybase.
  • I have a public key ASD5q6Mw3W2nH6hb64b5eFkJ4zQN1vzVZPS-yq9PiFMWvAo

To claim this, I am signing this object:

@duggiemitchell
duggiemitchell / timer-class.jsx
Last active Sep 9, 2019
Timer component written as a class
View timer-class.jsx
class Timer extends React.Component {
constructor(props) {
super(props);
this.state = { seconds: 0 };
}
tick = () => {
this.setState(state => ({
seconds: state.seconds + 1
}));
View keybase.md

Keybase proof

I hereby claim:

  • I am duggiemitchell on github.
  • I am duggie (https://keybase.io/duggie) on keybase.
  • I have a public key ASDGFLQpZPxDM2R8W_GkMM5jFUQCkFo2fibBo-1BDUHiHQo

To claim this, I am signing this object:

@duggiemitchell
duggiemitchell / MusicPreferences.tsx
Last active Mar 1, 2019
Stateful component called as a list that highlights to a random color on selection.
View MusicPreferences.tsx
type Props = {
navigation: NavigationScreenProp<NavigationParams>;
};
type State = {
musicPreferences: any;
};
export class MusicPreferencesScreen extends React.Component<Props, State> {
static navigationOptions = ({}) => {
View githubForm.jsx
// Write JavaScript here and press Ctrl+Enter to execute
const Card = (props) => {
return (
<div style={{margin: '1em'}}>
<img style={{width: 75}} src={props.avatar_url} />
<div style={{display: 'inline-block', marginLeft: 10}}>
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}>
{props.name}
</div>
@duggiemitchell
duggiemitchell / CounterApp.jsx
Created Oct 26, 2017
Example Counter Component in React
View CounterApp.jsx
class Button extends React.Component {
handleClick = () => {
this.props.onClickFn(this.props.incrementValue)
}
render() {
return (
<button onClick={this.handleClick}>
@duggiemitchell
duggiemitchell / simple-promise.md
Last active May 10, 2017
Simplest example of a promise
View simple-promise.md
let promiseToClean = new Promise(function( resolve, reject) { 
  // cleaning the room 
  
  let isClean = false;
  
  if (isClean){
    resolve('Clean');
  } else {
    reject('not Clean');
@duggiemitchell
duggiemitchell / .gitignore
Created Sep 20, 2016 — forked from octocat/.gitignore
Some common .gitignore configurations
View .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
View git-feature-workflow.md

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.

@duggiemitchell
duggiemitchell / how-to-ajax.js
Created Feb 16, 2016
Use Ajax to create interactive user experiences!
View how-to-ajax.js
//Simple AJAX call using `$.get` shorthand method instead of `$.ajax`
$(document).ready(function() {
$('#tour').on('click', 'button', function() {
$.get('/photos.html',function(response) {
$('.photos').html(response).fadeIn();
});
});
});
// data option of ajax function
You can’t perform that action at this time.