Skip to content

Instantly share code, notes, and snippets.

View duggiemitchell's full-sized avatar
🏠
Working from home

Erica Edge duggiemitchell

🏠
Working from home
View GitHub Profile
@duggiemitchell
duggiemitchell / how-to-ajax.js
Created February 16, 2016 05:56
Use Ajax to create interactive user experiences!
//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
@duggiemitchell
duggiemitchell / git-feature-workflow.md
Created August 23, 2016 18:58 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

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 / .gitignore
Created September 20, 2016 16:07 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@duggiemitchell
duggiemitchell / simple-promise.md
Last active May 10, 2017 14:48
Simplest example of a promise
let promiseToClean = new Promise(function( resolve, reject) { 
  // cleaning the room 
  
  let isClean = false;
  
  if (isClean){
    resolve('Clean');
  } else {
 reject('not Clean');
@duggiemitchell
duggiemitchell / CounterApp.jsx
Created October 26, 2017 14:55
Example Counter Component in React
class Button extends React.Component {
handleClick = () => {
this.props.onClickFn(this.props.incrementValue)
}
render() {
return (
<button onClick={this.handleClick}>
// 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 / MusicPreferences.tsx
Last active March 1, 2019 17:08
Stateful component called as a list that highlights to a random color on selection.
type Props = {
navigation: NavigationScreenProp<NavigationParams>;
};
type State = {
musicPreferences: any;
};
export class MusicPreferencesScreen extends React.Component<Props, State> {
static navigationOptions = ({}) => {

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 / timer-class.jsx
Last active September 9, 2019 14:41
Timer component written as a class
class Timer extends React.Component {
constructor(props) {
super(props);
this.state = { seconds: 0 };
}
tick = () => {
this.setState(state => ({
seconds: state.seconds + 1
}));

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: