Skip to content

Instantly share code, notes, and snippets.

View reatlat's full-sized avatar
🖖
Live long and prosper!

Alex Zappa reatlat

🖖
Live long and prosper!
View GitHub Profile
@reatlat
reatlat / README.md
Created January 6, 2016 11:40 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
/**
* version1: convert online image
* @param {String} url
* @param {Function} callback
* @param {String} [outputFormat='image/png']
* @author HaNdTriX
* @example
convertImgToBase64('http://goo.gl/AOxHAL', function(base64Img){
console.log('IMAGE:',base64Img);
})
@reatlat
reatlat / mixins.jade
Created March 11, 2016 09:59 — forked from shaneriley/mixins.jade
Jade mixins example
// Writing JS for everything is great and all, but I don't want to see JS
// inline in my Jade templates. Thankfully, there are ways of abstrating it
// into mixins!
// Want some Rails-like helpers?
mixin link_to(name, href)
- href = href || "#"
a(href="#{href}")= name
// How about a single editing point for a class name?
@reatlat
reatlat / gist:09acf7afed7d254ec5c0
Created March 25, 2016 08:29 — forked from skypce/gist:355e56d0774160bb5619
Upwork Client fix for Ubuntu 14.04 ( Unknown SSL error -12218 mapped to net::ERR_SSL_PROTOCOL_ERROR)
If you have this error: Unknown SSL error -12218 mapped to net::ERR_SSL_PROTOCOL_ERROR
and your upwork client does not run you need:
sudo apt-get install libnss3=2:3.15.4-1ubuntu7 libnss3-nssdb=2:3.15.4-1ubuntu7
sudo apt-mark hold libnss3 libnss3-nssdb
Solution provided by Ilya E from upwork.
!function(a,b){a.MixItUp.prototype.addAction("_constructor","pagination",function(){var b=this;b.pagination={limit:0,loop:!1,generatePagers:!0,maxPagers:5,pagerClass:"",prevButtonHTML:"&laquo;",nextButtonHTML:"&raquo;"},a.extend(b.selectors,{pagersWrapper:".pager-list",pager:".pager"}),a.extend(b.load,{page:1}),b._activePage=null,b._totalPages=null,b._$pagersWrapper=a()},1),a.MixItUp.prototype.addAction("_init","pagination",function(){var a=this;a._activePage=1*a.load.page,a.pagination.maxPagers="number"==typeof a.pagination.maxPagers&&a.pagination.maxPagers<5?5:a.pagination.maxPagers},1),a.MixItUp.prototype.addAction("_bindHandlers","pagination",function(){var b=this;b.pagination.generatePagers&&(b._$pagersWrapper=a(b.selectors.pagersWrapper)),b.controls.live?b._$body.on("click.mixItUp."+b._id,b.selectors.pager,function(){b._processClick(a(this),"page")}):b._$pagersWrapper.on("click.mixItUp."+b._id,b.selectors.pager,function(){b._processClick(a(this),"page")})},1),a.MixItUp.prototype.addAction("_processClick
<?php
/* ======================================================
This script is NOT FULLY TESTED (not tested on Windows Server either)
USE AT YOUR OWN RISK - development environment Ubuntu Linux 14.04.3 LTS
The purpose of this script is for small websites and blogs
to have their existing media to work through Amazon S3
There's a great plugin, WP Offload S3, that we'll be tapping
into...it works great for new media, but this is a quick
@reatlat
reatlat / functions.php
Created March 23, 2017 20:37
Get number of active WordPress widgets in a widget area
<?php
/**
* Count number of widgets in a sidebar
* Used to add classes to widget areas so widgets can be displayed one, two, three or four per row
*/
function slbd_count_widgets( $sidebar_id ) {
// If loading from front page, consult $_wp_sidebars_widgets rather than options
// to see if wp_convert_widget_settings() has made manipulations in memory.
global $_wp_sidebars_widgets;
@reatlat
reatlat / meta.hbs
Created June 8, 2017 18:28 — forked from ofstudio/meta.hbs
Meta tags snippet for Ghost Themes
{{!-- Tested on Ghost 0.5.7. --}}
{{!-- IMPORTANT! Some things are more likely to work in a different way in future versions of Ghost. Check the documentation --}}
{{#is "index, tag, author"}} {{!-- Meta for index, tag and author contexts --}}
{{#is "index"}}
<title>{{@blog.title}}</title>
<meta name="description" content="{{@blog.description}}"/>
<meta property="og:title" content="{{@blog.title}}"/>
<meta itemprop="name" content="{{@blog.title}}"/>
{{/is}}
{{#is "tag"}}
@reatlat
reatlat / examples.md
Created June 12, 2017 19:24 — forked from ErisDS/examples.md
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

@reatlat
reatlat / facebook
Created June 30, 2017 06:59 — forked from hotmeteor/facebook
Social media meta tag templates
<!-- Social: Facebook / Open Graph -->
<meta property="fb:admins" content="503386332">
<meta property="fb:app_id" content="1389892087910588">
<meta property="og:url" content="http://scotch.io/bar-talk/bootstrap-3-tips-and-tricks-you-might-not-know">
<meta property="og:type" content="article">
<meta property="og:title" content="Bootstrap 3 Tips and Tricks You Might Not Know">
<meta property="og:image" content="/wp-content/uploads/2014/05/bs31.jpg"/>
<meta property="og:description" content="Bootstrap 3 has a ton of features and helpers to speed up front-end development. Sometimes you need something and you end up writing your own custom CSS and JavaScript without even realizing that Bootstrap could have done it for you....">
<meta property="og:site_name" content="Scotch">
<meta property="article:author" content="https://www.facebook.com/NCerminara">