Skip to content

Instantly share code, notes, and snippets.

View ahmadajmi's full-sized avatar

Ahmad Ajmi ahmadajmi

View GitHub Profile
@aderaaij
aderaaij / background-image.haml
Created September 4, 2014 08:43
inline styles in variable image
.foo{:style => "background-image: url('#{current_page.data.imageurl}');"}
@yortz
yortz / gist:1394699
Created November 25, 2011 23:51 — forked from metaskills/gist:756111
Rails 3 Models To Export Mephisto To Jekyll & Disqus
require 'builder'
require 'digest/md5'
class Content < ActiveRecord::Base
belongs_to :user
end
class Section < ActiveRecord::Base
has_many :assigned_sections
has_many :articles, :order => 'position', :through => :assigned_sections
@whmii
whmii / gulpfile.js
Last active August 16, 2017 10:41
A handy gulpfile for use in ghost themes
var gulp = require('gulp');
var sass = require('gulp-sass'),
autoprefix = require('gulp-autoprefixer'),
bourbon = require('bourbon'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
zip = require('gulp-zip');
// Stylesheets
@ahmadajmi
ahmadajmi / phantomcss.md
Last active September 13, 2017 22:31
PhantomCSS example with Gulp
npm install gulp-phantomcss --save

gulpfile.js

var phantomcss      = require('gulp-phantomcss');

// PhantomCSS
@nathansmith
nathansmith / moz-webkit.css
Created March 22, 2011 01:51
Target Firefox and WebKit via hacky CSS.
/*
Read more here:
https://developer.mozilla.org/en/CSS/@-moz-document
For more browser-specific hacks:
http://paulirish.com/2009/browser-specific-css-hacks
*/
@-moz-document url-prefix() {
/* Put your Firefox specific code here. */
@tillsanders
tillsanders / README.markdown
Last active October 24, 2022 18:41
How to add a page with all tags to the Casper 2 theme for the Ghost CMS
@J2TEAM
J2TEAM / envato-preview-bypass.js
Created December 28, 2020 07:21
Bookmarklet to remove preview iframe on Envato sites (Themeforest, Codecanyon)
javascript:window.top.location.replace(document.querySelector('.full-screen-preview__frame').src);
@cypar
cypar / zip-excluding-specific-directories-and-files.md
Created February 17, 2016 03:13
Zip excluding specific directories and files

Zip excluding specific directories

Exclude .git file and node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/\*

Exclude .git file and files in node_modules directory, but keep node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/**\*
@ravasthi
ravasthi / _config.yml
Created February 15, 2012 08:59
Multiple authors on Jekyll
authors:
hanzou:
name: Hanzou Hattori
display_name: Hanzou
gravatar: c66919cb194f96c696c1da0c47354a6a
email: hanzou@company.com
web: http://company.com
twitter: company
github: hhattori
jorgen:
@Phlow
Phlow / for-loop-sorted-collection
Last active April 30, 2024 13:30
This Liquid loop for Jekyll sorts a collection by date in reverse order
{% comment %}
*
* This loop loops through a collection called `collection_name`
* and sorts it by the front matter variable `date` and than filters
* the collection with `reverse` in reverse order
*
* To make it work you first have to assign the data to a new string
* called `sorted`.
*
{% endcomment %}