Skip to content

Instantly share code, notes, and snippets.

View thegrid22593's full-sized avatar

Garrett Sanderson thegrid22593

View GitHub Profile
@thegrid22593
thegrid22593 / _fonts.scss
Created November 22, 2017 01:21
Mixin for creating font family for web fonts
$namespace-fonts: $font1, $font2, $font3;
$font-path: 'your/font/path';
// Font-face loader
@each $font-face in $namespace-fonts {
@font-face {
font-family: #{$font-face};
src: url('#{$font-path}/#{$font-face}.eot');
src: url('#{$font-path}/#{$font-face}.eot?') format('eot'),
url('#{$font-path}/#{$font-face}.woff') format('woff'),
@thegrid22593
thegrid22593 / _mixins.scss
Created November 22, 2017 01:23
Base mixin file I like to use for my scss projects
// iOS issue where native components in forms scale view port fix
@mixin nativeiOScomponentScale() {
input[type="text"], input[type="text"]:focus, select:focus, textarea:focus, input:focus {
font-size: 16px !important;
}
}
@mixin fontSmoothing() {
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: none;
@thegrid22593
thegrid22593 / _variables.scss
Created November 22, 2017 01:24
Base sass variables file I like to use on my projects
//Fonts
$font-main: 'Interstate-Regular';
$font-secondary: 'proximanova';
// Colors
$color-black: #000;
$color-white: #fff;
// Main Colors
$color-primary: #787772;
@thegrid22593
thegrid22593 / files.ts
Created November 22, 2017 01:26
Upload files to firebase for angular
filebuttoni(event) {
let files = event.srcElement.files[0];
let self = this;
let uploader = document.getElementById("uploader");
this.path = "user-profile-pics/"+files.name;
this.storageref = this.storage.child(this.path);
let uploadTask = this.storageref.put(files);
uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, function(snapshot) {
let progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
<?php
include(str_replace('//','/',dirname(__FILE__).'/') .'../app/config.php');
include(str_replace('//','/',dirname(__FILE__).'/') .'mailchimp.php');
use \DrewM\MailChimp\MailChimp;
# | some unnecessary variable stuff for crappy servers
$referralURL = $_POST['referralURL'];
$notification = $_POST['notification'];
$email = $_POST['email'];
$source = $_POST['source'];
@thegrid22593
thegrid22593 / api.js
Created November 22, 2017 01:39
Basic Express API Routing
const express = require('express');
const router = express.Router();
const db = require('./../db/db.js');
router.get('/projects', (req, res) => {
console.log('you hit projects');
Project.find(function (err, projects) {
if(!err) {
console.log(projects);
res.json(projects);
@thegrid22593
thegrid22593 / gulpfile-old.js
Created November 22, 2017 01:41
WordPress Dev Gulpfile
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');
@thegrid22593
thegrid22593 / functions.php
Created November 22, 2017 01:42
WordPress Custom Post Type Register Function
add_action('init', 'create_units_post_type');
function create_units_post_type() {
$labels = array(
'name' => __('Site Plan'),
'singular_name' => __('Unit'),
'all_items' => __('All Units'),
'add_new' => _x('Add new Unit', 'Unit'),
'add_new_item' => __('Add new Unit'),
@thegrid22593
thegrid22593 / gulpfile.js
Last active April 26, 2018 18:42
Gulpfile for wordpress theme development
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var plumber = require('gulp-plumber');
#### Forward entire domain
```
RedirectMatch 301 ^(.*)$ http://www.valenciamorganhill.com/
```
#### Forward entire domain alt.
```
RewriteEngine On
RewriteBase /