Skip to content

Instantly share code, notes, and snippets.

Avatar
🐵
🚀 🤖

Jade Dominguez plusjade

🐵
🚀 🤖
View GitHub Profile
@daneden
daneden / Readme.md
Last active Apr 12, 2016
Aspirational Dropbox SCSS Guidelines (Draft)
View Readme.md
@staltz
staltz / introrx.md
Last active Sep 21, 2020
The introduction to Reactive Programming you've been missing
View introrx.md
@Jesus
Jesus / config_files.rb
Last active Apr 1, 2020
Config. file uploader task for Capistrano 3
View config_files.rb
# lib/capistrano/tasks/config_files.cap
#
# Capistrano task to upload configuration files outside SCM
# Jesus Burgos Macia
#
# This allows us to have server's config files isolated from development ones.
# That's useful for several reasons, but the most important is that you can
# ignore files from repository.
#
# The task will upload all files found in
@traviskaufman
traviskaufman / jasmine-this-vars.md
Last active Aug 24, 2020
Better Jasmine Tests With `this`
View jasmine-this-vars.md

Better Jasmine Tests With this

On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this object, and we've seen some awesome benefits from doing such.

The old way

Up until recently, a typical unit test for us looked something like this:

describe('views.Card', function() {
@razor-x
razor-x / README.md
Last active Feb 19, 2020
Load GitHub Gists asynchronously and optionally specify which file to show.
View README.md

Load GitHub Gists asynchronously

This is now a Bower package: [gist-async]. [gist-async]: https://github.com/razor-x/gist-async

Requires jQuery.

Jekyll plugin included that modifies the gist markup added by its gist Liquid tag.

Load GitHub Gists asynchronously and optionally specify which file to show.

@indolent-gnathostome
indolent-gnathostome / pagination.rb
Last active Dec 31, 2015
Independent, sortable pagination for ruhoh.rb (plugin)
View pagination.rb
module SortablePaginator
# provides helpful metrics for the paginator and mustache templates
def paginator_data
per_page = config["paginator"]["per_page"] rescue 5
paginator_sort = config["paginator"]["sort"] rescue 'desc'
current_page = master.page_data['current_page'].to_i
post_count = all.length
page_count = (post_count.to_f/per_page).ceil
if paginator_sort == 'asc'
@mudasobwa
mudasobwa / plugins-views-helpers-paginator.rb
Last active Dec 29, 2015
Paginator helper for ruhoh, collapsing page links when there are a lot of posts.
View plugins-views-helpers-paginator.rb
module Ruhoh::Views::Helpers
module Paginator
# current_page is set via a compiler or previewer
# in which it can discern what current_page to serve
def paginator
per_page = config["paginator"]["per_page"] rescue 5
current_page = master.page_data['current_page'].to_i
current_page = current_page.zero? ? 1 : current_page
offset = (current_page-1)*per_page
@michael-harrison
michael-harrison / test_multi_select.rb
Created Nov 18, 2012
jQuery Chosen Testing with Capybara
View test_multi_select.rb
=begin
Notes
=====
Labels: On the label you should put a "for" attribute if you're not using something like simple_form
This helps capybara to find your field
e.g. <label for="my_field_id">Some label</label>
=end
field = "Label on my field"
value = "existing option in list"
@clintongormley
clintongormley / gist:4095280
Created Nov 17, 2012
Using synonyms in Elasticsearch
View gist:4095280

We create an index with:

  • two filters: synonyms_expand and synonyms_contract
  • two analyzers: synonyms_expand and synonyms_contract
  • three text fields:
    • text_1 uses the synonyms_expand analyzer at index and search time
    • text_2 uses the synonyms_expand analyzer at index time, but the standard analyzer at search time
    • text_3 uses the synonyms_contract analyzer at index and search time

.

@douo
douo / wp_to_ruhoh.rb
Created Aug 21, 2012
wordpress export xml to ruhoh post
View wp_to_ruhoh.rb
# coding: utf-8
# chcp 65001
require 'rubygems'
require 'hpricot'
require 'nokogiri'
require 'fileutils'
require 'yaml'
require 'time'
require 'pandoc-ruby'
You can’t perform that action at this time.