Skip to content

Instantly share code, notes, and snippets.

View qodesmith's full-sized avatar
👨‍💻
How can I help build you something awesome?

Aaron Cordova qodesmith

👨‍💻
How can I help build you something awesome?
View GitHub Profile
@qodesmith
qodesmith / basic-methods.js
Created June 10, 2019 00:23
Vanilla JavaScript - basic methods to primitive types that any developer should know
/////////////
// STRINGS //
/////////////
// https://mzl.la/2ZiPyGL - .split
// https://mzl.la/2Zh3XTQ - .repeat
// https://mzl.la/2ZjaT3c - .startsWith
// https://mzl.la/2ZeuLUW - .endsWith
// https://mzl.la/2ZfUxIk - .trim
// https://mzl.la/2Z9sBWG - .toUpperCase
@qodesmith
qodesmith / index.html
Created September 9, 2018 22:29
Weather App
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
@qodesmith
qodesmith / config.js
Last active February 21, 2020 06:48
Webpack 4 babel-loader config
/*
Relevant packages used:
-----------------------
"@babel/core": "^7.0.0-beta.40",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.40",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.40",
"@babel/preset-env": "^7.0.0-beta.40",
"@babel/preset-react": "^7.0.0-beta.40",
"babel-loader": "^8.0.0-beta.2",
@qodesmith
qodesmith / webpack.config.js
Created October 31, 2017 14:37
Example Webpack configuration generated from `create-new-app` with the `-m` option.
/*
This file is a copy of what's generated when using the `create-new-app` package with the `-m` option.
`create-new-app` is the full-stack version of `create-react-app` but with options.
`create-new-app` - https://www.npmjs.com/package/create-new-app
*/
require('dotenv').load(); // https://goo.gl/Cj8nKu
const { NODE_ENV } = process.env
const isProd = NODE_ENV === 'production';
const path = require('path');
@qodesmith
qodesmith / avgColor.js
Last active July 26, 2016 21:35 — forked from olvado/getAverageColourAsRGB.js
Get the average colour of an image in javascript using getImageData in CANVAS
function avgColor(imageUrl) {
var canvas = document.createElement('canvas');
var context = canvas.getContext && canvas.getContext('2d');
var rgb = {r: 102, g: 102, b: 102}; // Set a base colour as a fallback for non-compliant browsers
var pixelInterval = 5; // Rather than inspect every single pixel in the image inspect every 5th pixel
var count = 0;
var i = -4;
var img = document.createElement('img');
var data;
var length;
@qodesmith
qodesmith / stylePseudo.js
Last active February 2, 2016 14:45
Function for styling pseudo elements with JavaScript
function pseudo(el, css) {
var string = '';
for(var i in css) {
string += i
+ ':'
+ css[i]
+ ';';
}