Skip to content

Instantly share code, notes, and snippets.

@moxdev
moxdev / config.rb
Created June 2, 2016 15:50 — forked from bcinarli/config.rb
Bourbon based SASS config and debug options After import the config file, you can call bourbon as @import "bourbon"
# define bourbon path, use a common library for preventing duplicates
add_import_path "path/to/your/bourbon/lib"
### -->> project paths, delete/comment if you use scout, codekit etc.
environment = :production # removes single line comments, keeps css comments
output_style = :compact
css_dir = "styles" #relative to project root
sass_dir = "styles-sass" #relative to project root
images_dir = "images" #relative to project root
@moxdev
moxdev / ohmyzsh-dropbox-sync.sh
Created June 3, 2016 01:58 — forked from robbyrussell/ohmyzsh-dropbox-sync.sh
Keep your @ohmyzsh ~/.zshrc in sync via dropbox
# Was asked how I keep my zshrc config sync'd between my computers with Dropbox
# Add a new directory in your Dropbox (or use an existing one)
mkdir -p ~/Dropbox/ohmyzsh
# move existing file to Dropbox
mv ~/.zshrc ~/Dropbox/ohmyzsh/zshrc
# symlink file back to your local directory
ln -s ~/Dropbox/ohmyzsh/zshrc ~/.zshrc
/**
*
* Gulpfile setup
*
* @since 1.0.0
* @authors Ahmad Awais, @digisavvy, @desaiuditd, @jb510, @dmassiani and @Maxlopez
* @package neat
* @forks _s & some-like-it-neat
*/
@moxdev
moxdev / gulpfile.js
Created June 9, 2016 19:04
Basic Gulp-Sass-WordPress gulp file
/**
* Configuration.
*
* Project Configuration for gulp tasks.
*
* Edit the variables as per your project requirements.
*/
// Project related.
var project = 'Sass WPGulpTheme'; // Project Name.
@moxdev
moxdev / my_async_script.php
Last active June 15, 2016 20:13
If you need to load an enqueued script asynchronously in WordPress, or modify the <script> element in any other way, you can use code like the following:
/**
* Add async attributes to enqueued scripts where needed.
* The ability to filter script tags was added in WordPress 4.1 for this purpose.
* http://scottnelle.com/756/async-defer-enqueued-wordpress-scripts/
*/
function my_async_scripts( $tag, $handle, $src ) {
// the handles of the enqueued scripts we want to async
$async_scripts = array( 'some-script', 'another-script' );
if ( in_array( $handle, $async_scripts ) ) {
@moxdev
moxdev / function.php
Created June 23, 2016 18:45
How to move WordPress default jQuery and jQuery UI into footer instead of head
// This goes in the theme function.php with the other registered scripts
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', includes_url( '/js/jquery/jquery.js' ), false, NULL, true );
wp_deregister_script( 'jquery-ui-core' );
wp_register_script( 'jquery-ui-core', includes_url( '/js/jquery/ui/widget.min.js' ), false, NULL, true );
@moxdev
moxdev / border-diveder.css
Created August 3, 2016 15:20
Border Divider
border-top: 1px solid #3e4047;
box-shadow: 0 -1px 0 #000;
@moxdev
moxdev / mobile-first-mixin.scss
Created August 10, 2016 19:34
Mobile first Sass mixin for common breakpoints
// iPhone, min-width: 320px
// mobile, min-width: 480px
// tablet, min-width: 768px
// laptop, min-width: 992px
// desktop, min-width: 1200px
@mixin respond-to($breakpoint) {
@if $breakpoint == "iphone" {
@media (min-width: 320px) {
@content;
@moxdev
moxdev / mobile-first-mixin-elegant.scss
Created August 10, 2016 19:36
Mobile first mixin using the source map as the breakpoint
// https://www.sitepoint.com/managing-responsive-breakpoints-sass/
$breakpoints: (
'small' : ( min-width: 767px ),
'medium' : ( min-width: 992px ),
'large' : ( min-width: 1200px )
);
@mixin respond-to($name) {
// If the key exists in the map
@moxdev
moxdev / gulpfile.js
Created August 25, 2016 20:41
Initial setup of word press gulpfile
/**
*
* Gulpfile setup
*
* @since 1.0.0
* @authors Ahmad Awais, @digisavvy, @desaiuditd, @jb510, @dmassiani and @Maxlopez
* @package neat
* @forks _s & some-like-it-neat
*/