Skip to content

Instantly share code, notes, and snippets.

@agragregra
agragregra / .htaccess
Created October 10, 2016 10:46
htaccess index.html & www redirect
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} www.placeburg.com [NC]
RewriteRule (.*) http://placeburg.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.(htm(l)?|php)\ HTTP/
RewriteRule ^(([^/]+/)*)index\.(htm(l)?|php)$ http://placeburg\.com/$1 [R=301,L]
{{ post.content | strip_html | truncatewords: 28 }}
@agragregra
agragregra / jekyll-category post-list.html
Created October 10, 2016 10:27
Jekyll Category Post List
{% for post in site.categories.[page.category] limit: 8 %}
{% include photo-item.html %}
{% endfor %}
@agragregra
agragregra / jekyll-menu.html
Created October 10, 2016 10:18
Jekyll Menu
<ul>{% for my_page in site.pages %}
{% if my_page.title %}
<li><a href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a></li>
{% endif %}
{% endfor %}</ul>
@agragregra
agragregra / jquery-filter-by-field.js
Last active April 1, 2019 08:49
jQuery Input Field Filter
$(".city-input").keyup(function() {
filter(this);
});
function filter(element) {
var value = $(element).val().toLowerCase();
$("[data-filter]").each(function () {
var $this = $(this),
lower = $this.data("filter").toLowerCase();
if (lower.indexOf(value) > -1) {
$this.show();
@agragregra
agragregra / jekyll-post-naxt-prev-navigation.rb
Created October 10, 2016 10:08
Jekyll Post Navigation (Prev & Next Posts)
module Jekyll
class WithinCategoryPostNavigation < Generator
def generate(site)
site.categories.each_pair do |category, posts|
posts.sort! { |a,b| b <=> a}
posts.each do |post|
index = posts.index post
next_in_category = nil
previous_in_category = nil
if index
@agragregra
agragregra / gulpfile.js
Created October 10, 2016 09:57
Image Resize + Watermark + Thumbnails
var src = "___library/7-kazan/1/*";
var dst = "_ready";
var gulp = require('gulp'),
imagemin = require('gulp-imagemin'),
cache = require('gulp-cache'),
del = require('del'),
imageResize = require('gulp-image-resize'),
watermark = require("gulp-watermark"),
rename = require("gulp-rename");
@agragregra
agragregra / migx-sample.js
Last active January 24, 2023 08:35
MIGX Sample
Tabs:
[
{"caption":"Tab Title", "fields": [
{"field":"title","caption":"Name"},
{"field":"description","caption":"Description","inputTVtype":"textarea"},
{"field":"imageTV","caption":"Photo","inputTV":"imageTV"}
]}
]
Table:
@agragregra
agragregra / equalHeight-Set.js
Last active October 10, 2019 07:38
equalHeights Set
function heightses() {
$(".program-item").height("auto").equalHeights();
}heightses();
$(window).resize(function() {
heightses();
});
@agragregra
agragregra / scroll-next.js
Created August 5, 2016 09:01
jQuery Scroll To Next Section
$(".scroll-next").click(function() {
var cls = $(this).closest(".section").next().offset().top;
$("html, body").animate({scrollTop: cls}, "slow");
});