Skip to content

Instantly share code, notes, and snippets.

View Designer023's full-sized avatar

Carl Topham Designer023

View GitHub Profile
@Designer023
Designer023 / App.js
Created April 17, 2017 14:38
App JS brand new
import React, { Component } from 'react';
class App extends Component {
render() {
return (
<div>
<h1>Hello React!</h1>
</div>
);
}
@Designer023
Designer023 / App.js
Created April 17, 2017 14:37
App JS initial
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<div className="App-header">
<img src={logo} className="App-logo" alt="logo" />
npm install -g create-react-app
create-react-app react-01
cd react-01/
npm start
@Designer023
Designer023 / chartjs.js
Last active March 2, 2017 12:30
chartjs data example
var data = {
labels: ["M", "T", "W", "T", "F", "S", "S"],
datasets: [{
data: [1,2,3,3,2,5,4],
backgroundColor: 'rgba(200,100,100,1)'
},
{
data: [4,3,2,5,2,7,4],
backgroundColor: 'rgba(100,200,200,1)'
}]
@Designer023
Designer023 / scroll-top.js
Created September 6, 2016 10:44
JQuery Scroll top function
//Scroll Top button
$(document).ready(function() {
var scroll_up_button = $('<span class="scroll-up-button"><i class="fa fa-chevron-up"></i></span>');
$('body').append( scroll_up_button );
var timer;
$(window).scroll(function() {
@Designer023
Designer023 / gulpfile.js
Created July 25, 2016 15:15
Basic Sass Gulp Setup
var gulp = require('gulp'),
gulpLoadPlugins = require('gulp-load-plugins'),
del = require('del'),
plugins = gulpLoadPlugins({
rename: {
'gulp-util': 'gutil',
'gulp-minify-css': 'minifyCSS',
'gulp-sass' : 'sass'
},
@Designer023
Designer023 / google.md
Last active July 15, 2016 09:48
How to google things good!

How to google things:

These will often give similar results, however for less common searches the proper formatting works far better

Format:

[environment] [element] [property|feature] [argument]

Examples - Good

@Designer023
Designer023 / flex-fixes.scss
Last active July 18, 2016 09:32
Flexbox fixes
.wrapper {
//Default
display: flex;
//Firefox >= 27 : Does not support flex-wrap or flex-flow properties
@supports not (flex-wrap: wrap) {
> * { display: inline; }
}
// Comments in Sass can be written with a double slash. These don't appear in the outputted CSS
/* Comments done in the CSS style will still be compiled to the resulting CSS */
// Styles that would have to be written out repetedly by hand can be nested
.base-class {
display: block;
.sub-class {
display: block;
@Designer023
Designer023 / classes.html
Last active July 8, 2016 14:44
Class Types
<!-- Template & hardcoded classes -->
<span>BAD</span>
<div>BAD</div>
<h1>BAD</h1>
<div class="some-class">
<div>
<div>
<span>BAD</span>
</div>
</div>