Skip to content

Instantly share code, notes, and snippets.

View mccombs's full-sized avatar
🔍
Build. Breathe. Repeat.

Adam McCombs mccombs

🔍
Build. Breathe. Repeat.
View GitHub Profile
@mccombs
mccombs / Gulp
Last active August 29, 2015 14:19
Take a big Gulp!
var gulp = require('gulp'),
less = require('gulp-less'),
livereload = require('gulp-livereload'),
notify = require('gulp-notify');
minifycss = require('gulp-minify-css');
gutil = require('gulp-util');
gulp.task('less', function() {
return gulp.src(['../blog/css/*.less'], {base: '../blog/css/'})
.pipe(less().on('error', function(err){
@mccombs
mccombs / gist:b6135b5e525d32da553d
Created April 23, 2015 18:29
Git remote set-url orgin
git remote set-url origin git@github.com:user/repo.git
@mccombs
mccombs / craft_db.php
Last active August 29, 2015 14:21
Sample Craft db file
<?php
if ($_SERVER['SERVER_NAME'] == 'local.sitename')
{
return array(
'server' => 'localhost',
'user' => 'user',
'password' => 'password',
'database' => 'database',
'tablePrefix' => 'craft',
@mccombs
mccombs / craft_general.php
Last active August 29, 2015 14:21
Sample Craft general config file
<?php
return array(
'domain.com' => array(
//'devMode' => true,
'omitScriptNameInUrls' => true,
'environmentVariables' => array(
'siteUrl' => 'http://domain.com/',
'fileSystemPath' => '',
)
#
brew tap exolnet/homebrew-deprecated
brew install php@5.6
UPDATE exp_members
SET password = SHA1('pass123')
WHERE member_id = 1
@mccombs
mccombs / prodDbSync.sh
Last active October 15, 2020 23:23
BASH - Sync DB | Prod -> Local
#!/bin/bash
# Big thanks to @sam_h for this! Works like a charm.
#
# This script assumes you have ssh access to a remote server
# Both databases are backed up to sql files in the same directory
# this script is executed from.
# Usage:
# 1. Make sure this file is executable with `chmod +x mysqlsync`
# 2. Set the credentials for the variables at the top
@mccombs
mccombs / matrixloop.twig
Last active August 18, 2021 02:12
Craft Matrix Block Loop
{% for block in entry.pageBuilder %}
{% switch block.type %}
{% case block.type %}
{% include "pages/_parts/_" ~ block.type ~ ".twig" %}
{% endswitch %}
{% endfor %}
<script lang="js" defer>
let referrer = document.referrer;
let location = window.location;
let userAgent = navigator.userAgent;
let userAgentData = navigator.userAgentData;
console.log(location, userAgent, userAgentData);
let person = {
referrer: referrer,