Skip to content

Instantly share code, notes, and snippets.

View justyn-clark's full-sized avatar
🌬️

Justyn Clark justyn-clark

🌬️
View GitHub Profile
@justyn-clark
justyn-clark / .gitignore
Last active February 11, 2024 20:46 — forked from redoPop/.gitignore
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@justyn-clark
justyn-clark / gruntfile.js
Created January 13, 2016 22:39
Browserify + React compilation on file save
var fs = require('fs');
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
env: {
build: {
NODE_ENV: 'production'
}
@justyn-clark
justyn-clark / index.html
Created February 20, 2017 04:54
JS Bin [add your bin description] // source http://jsbin.com/sicaku
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.items {
color: blue;
@justyn-clark
justyn-clark / index.html
Last active February 11, 2024 20:45
Promises
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<button id="btn">Make a promise!</button>
<div id="log"></div>
<script src="scripts.js"></script>
// Example One
(function(){
var request;
if (window.XMLHttpRequest) {
request = new XMLHttpRequest();
} else {
request = new ActiveXObject("Microsoft.XMLHTTP");
}
request.onreadystatechange = function() {
@justyn-clark
justyn-clark / package.json
Last active February 11, 2024 20:45
ES6 JS - A quick JS starter project
{
"name": "js-starter",
"version": "1.0.0",
"description": "A quick JS starter project",
"main": "src/js/app.js",
"author": "Justyn Clark",
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-preset-env": "^1.6.0",
@justyn-clark
justyn-clark / index.html
Last active February 11, 2024 20:45
JS SCSS Starter - A quick JS SCSS Starter Project
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JS SCSS Starter</title>
<link rel="stylesheet" href="dist/style.css">
</head>
<body>
<script src="dist/scripts.js"></script>
</body>
@justyn-clark
justyn-clark / classlessOOP.js
Last active February 11, 2024 20:45
classless OOP
function constructor(spec) {
let
{member} = spec,
{other} = other_constructor(spec),
method = function () {
// member, other, method, spec
};
return Object.freeze({
method,
other
.aspect-ratio($width, $height) {
position: relative;
&:before {
display: block;
content: '';
width: 100%;
height: 0;
padding-top: ($height / $width) * 100%;
}
}
@justyn-clark
justyn-clark / amdModule.js
Created January 18, 2018 23:02
AMD Module
;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.JUSTYNCLARK = factory();
}