Skip to content

Instantly share code, notes, and snippets.

View schikulski's full-sized avatar

Simen Schikulski schikulski

View GitHub Profile
@schikulski
schikulski / Replace Bootstrap with Foundation for Sage.md
Last active May 5, 2017 12:03
Replace Bootstrap with Foundation for Roots/Sage

How to replace Bootstrap with Foundation for Roots/Sage

1. Clone, clean and install

  • Clone repo: git clone https://github.com/roots/sage.git
  • Remove Bootstrap: bower uninstall bootstrap-sass -S
  • Install Foundation: bower install foundation -S
  • Install NPM packages: npm install

2. Add Foundation overrides to bower.json like this:

<?php if (($wp_query->current_post +1) == ($wp_query->post_count)) {
echo 'This is the last post';
} ?>
<?php if (($wp_query->current_post +1) != ($wp_query->post_count)) {
echo 'This is the not the last post';
} ?>
@schikulski
schikulski / post-types.php
Last active August 29, 2015 14:08
Post types template for Wordpress
<?php
add_action( 'init', 'register_cpt_example' );
function register_cpt_example() {
//// Label parameters for the CPT admin
$labels = array(
'name' => _x( 'Examples', 'example' ),
'singular_name' => _x( 'Example', 'example' ),
@schikulski
schikulski / Mina WordPress deploy
Created May 5, 2014 19:55
Mina WordPress deploy config
require 'mina/git' # Require mina/git
set :term_mode, nil # Bug in OS X that makes the password promp kinda fishy...
set :domain, 'example.com' # The web servers SSH domain
set :deploy_to, '/home/user/my-site' # Full path to where you want Mina to deploy
set :repository, 'https://USERNAME@bitbucket.org/USERNAME/REPOSITORY.git' # The git repository Mina shall use
set :branch, 'master' # What git branch Mina should get
set :user, 'username' # What username to connect with through SSH
set :current_path, 'www' # What file should be the current version. Probably 'www', 'public_html' or perhaps 'current'.
@schikulski
schikulski / script.js
Created May 3, 2014 17:41
A Pen by Simen.
var gulp = require('gulp'); // Gulp!
var sass = require('gulp-sass'); // Sass
var prefix = require('gulp-autoprefixer'); // Autoprefixr
var minifycss = require('gulp-minify-css'); // Minify CSS
var concat = require('gulp-concat'); // Concat files
var uglify = require('gulp-uglify'); // Uglify javascript
var svgmin = require('gulp-svgmin'); // SVG minify
var imagemin = require('gulp-imagemin'); // Image minify
var rename = require('gulp-rename'); // Rename files
@schikulski
schikulski / gist:8932319
Created February 11, 2014 10:15
Wordpress: wrap 3 and 3 posts
<?php
if(have_posts()) : for($count=0;have_posts();$count++) : the_post();
$open = !($count%3) ? '<div class="threeacross">' : ''; //Create open wrapper if count is divisible by 3
$close = !($count%3) && $count ? '</div>' : ''; //Close the previous wrapper if count is divisible by 3 and greater than 0
echo $close.$open;
?>
<?php // do stuff ?>
@schikulski
schikulski / gist:8862236
Created February 7, 2014 13:00
Wordpress: query a singel page
<?php $page = new WP_Query("page_id=8"); while($page->have_posts()) : $page->the_post();?>
<?php endwhile; ?>
@schikulski
schikulski / custom.php
Created December 6, 2013 09:04
Wordpress: simple shortcode
//[googlemaps]
function googlemaps_func( $atts ){
return '<div class="Flexible-container"><div id="hartzkart"></div></div>';
}
add_shortcode( 'googlemaps', 'googlemaps_func' );
@schikulski
schikulski / wp-config.php
Created August 7, 2013 11:45
wp-config.php
<?php
// ===================================================
// Load database info and local development parameters
// ===================================================
if ( file_exists( dirname( __FILE__ ) . '/wp-config-local.php' ) ) {
define( 'WP_LOCAL_DEV', true );
define('WP_DEBUG', true);
require ('wp-config-local.php');
} elseif (file_exists(dirname(__FILE__) . '/wp-config-playground.php')) {
@schikulski
schikulski / composer.json
Created June 27, 2013 08:10
Composer template
{
"name": "simenschi/project",
"description": "My Project",
"keywords": ["keyword"],
"require": {
"laravel/framework": "4.0.*"
},
"autoload": {
"classmap": [
"path/to/class"