Skip to content

Instantly share code, notes, and snippets.

View juanjoseijas's full-sized avatar
💭
I may be slow to respond.

Juanjo Seijas juanjoseijas

💭
I may be slow to respond.
View GitHub Profile
@juanjoseijas
juanjoseijas / google_fonts_helper.rb
Created January 21, 2018 19:53
Google Fonts helper
def google_fonts(*query)
raise ArgumentError, 'Expected at least one font.' if query.empty?
if query.first.is_a? Hash
query = [*query.first].transpose
query = [query.first, query.last.to_enum]
end
api_base_url = 'http://fonts.googleapis.com/css'
# Iterate through given font families, building the query string from them and given styles
query_string = '?family=' + [*query.first].collect { |family|
# Stringify and title-case family name, replacing underscores with spaces
@juanjoseijas
juanjoseijas / grid.scss
Last active January 10, 2018 15:42
Grid with Susy3 + Flexbox
@import "susy/sass/susy";
@import 'susy/sass/plugins/svg-grid/';
$susy: (
'columns': susy-repeat(6),
'gutters': 2em,
'svg-grid-colors': hsla(180, 50%, 50%, 0.25),
);
@juanjoseijas
juanjoseijas / gist:65d3e572ae9c744f840a2505eb1b0f00
Created November 17, 2017 14:40
Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
@juanjoseijas
juanjoseijas / spacing.scss
Created November 16, 2017 12:16
Bulma spacing
$sizeUnit: rem;
$marginKey: 'has-margin';
$paddingKey: 'has-padding';
$separator: '-';
$sizes: (
('none', 0),
('xxs', 0.125),
('xs', 0.25),
('sm', 0.5),
('md', 1),
@juanjoseijas
juanjoseijas / middlemanAnvilConfiguration
Last active September 18, 2015 19:37 — forked from RyanParsley/middlemanAnvilConfiguration
Create a new Middleman project and make it work with Anvil.
middleman init my_new_project --rack
rvm --create --ruby-version use 1.9.3
rvm env . -- --env > .powenv
.location .blip {
position: relative;
display: inline-block;
height: 30px;
width: 30px;
left: -10px;
}
.location .blip .blip-base {
position: absolute;
height: 10px;
@juanjoseijas
juanjoseijas / gist:707b1cfb0b8dd8d45e5d
Created November 19, 2014 19:29
Using HTTParty To Fetch Facebook
require 'rubygems'
require 'httparty'
## define class
class Facebook
## load and inherit HTTParty class
include HTTParty
## set the default base URI
base_uri 'https://graph.facebook.com'
## set the format to JSON, so that HTTParty will automatically decode it
@juanjoseijas
juanjoseijas / backup.sh
Last active January 2, 2016 14:48
Backup (mysql dump) all your MySQL databases in separate files
#! /bin/bash
TIMESTAMP=$(date +"%F")
BACKUP_DIR="/backup/$TIMESTAMP"
MYSQL_USER="backup"
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD="password"
MYSQLDUMP=/usr/bin/mysqldump
mkdir -p "$BACKUP_DIR/mysql"
@juanjoseijas
juanjoseijas / markdown-yaml
Created November 12, 2013 23:17
helper to process yaml as markdown
def markdown(text)
Tilt['markdown'].new { text }.render(scope=self)
end
@juanjoseijas
juanjoseijas / site.yml
Created April 3, 2013 13:21
Sitemap for Middleman
url: http://www.example.com