Skip to content

Instantly share code, notes, and snippets.

View erikJonsberg's full-sized avatar
🏠
Working from home

Erik Jonsberg erikJonsberg

🏠
Working from home
View GitHub Profile
@erikJonsberg
erikJonsberg / .gitignore
Created May 1, 2017 13:55 — forked from redoPop/.gitignore
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@erikJonsberg
erikJonsberg / flexbox-grid.css
Last active April 17, 2017 18:44
Flexbox 3 and 4 column grid
.flex-container {
display: flex;
margin-top: 20px;
align-items: baseline;
}
.flex-item-4 {
display: flex;
flex-direction: column;
flex: 0 1 23.5%;
background: transparent;
@erikJonsberg
erikJonsberg / bootstrap-navbar-breakpoint.css
Created April 4, 2017 12:17
Adjust breakpoint of BS navbar
@media (max-width: 991px) {
.navbar-header {
float: none;
}
.navbar-left,.navbar-right {
float: none !important;
}
.navbar-toggle {
display: block;
}
@erikJonsberg
erikJonsberg / smooth-scroll.js
Created January 12, 2017 22:48
Smooth scroll to anchor with offset
$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top - 100
}, 1000);
return false;
@erikJonsberg
erikJonsberg / bs-bg-carousel.css
Last active January 12, 2017 22:52
Bootstrap carousel fullscreen background fader
@erikJonsberg
erikJonsberg / flexbox-navbar.html
Last active January 12, 2017 22:55
Cool animated bs navbar with flexbox
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Animated Header</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Raleway:400,700,600,500' rel='stylesheet'>
@erikJonsberg
erikJonsberg / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console