Skip to content

Instantly share code, notes, and snippets.

View johnlaine1's full-sized avatar

John Laine johnlaine1

View GitHub Profile
echo 'Hello World';
<?php
/**
* This file will demonstrate a method to export fields to code.
* You can use this to easily create fields using the UI, export to code
* and then use in a custom module. Upon installation of the module
* your fields and instances will already be set up.
*/
// Create the fields you want using the Drupal UI.
// On the same site, go to example.com/devel/php
@johnlaine1
johnlaine1 / tar_example.sh
Created August 14, 2013 04:45
Tar example
tar cvzf archive_name.tar.gz dirname/
drush php-eval 'node_access_rebuild();'
@johnlaine1
johnlaine1 / now.sh
Last active December 21, 2015 15:39
Add the current date to a file in linux.
now=$(date +"%m_%d_%Y")
touch my_file_$now
# Will output something like my_file_08_20_2013
# You can also do this, which will have the same results
touch my_file_$(date +"%m_%d_%Y")
@johnlaine1
johnlaine1 / new_gist_file
Created August 29, 2013 03:05
How to tar.gz a directory
$ tar cvzf archive_name.tar.gz dirname/
@johnlaine1
johnlaine1 / Flexbox Off Canvas Menu.markdown
Created April 24, 2016 22:28
Flexbox Off Canvas Menu
@johnlaine1
johnlaine1 / .bowerrc
Created June 5, 2016 00:05 — forked from Ehesp/.bowerrc
Gulp Workflow Snippet
{
"directory" : "src/assets/components"
}
@johnlaine1
johnlaine1 / gulpfile.js
Last active July 4, 2016 15:42
gulp example
'use strict';
// Load our dependencies.
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var htmlMin = require('gulp-htmlmin');
var useref = require('gulp-useref');
var uglify = require('gulp-uglify');
var lazypipe = require('lazypipe');
var gulpIf = require('gulp-if');
# Useful git commands
git log --oneline --abbrev-commit --all --graph --decorate --color