This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Place this file in /usr/local/bin/ | |
# It uses Github API to generate the HTML from the Markdown | |
# It includes the Primer CSS stylesheet | |
# It adds the body class needed and some spacing for the body | |
# It opens Chrome with the HTML generated | |
# It deletes the file when you interrupt the process | |
require 'bundler/inline' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// somewhere in ./app.js | |
if (this.state.authenticated) { | |
this.cable = connectWS(accessToken, client, uid); | |
} | |
// ./channels/connection.js | |
import ActionCable from 'actioncable'; | |
import { env } from '../env_vars'; | |
export function connectWS(accessToken, client, uid) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.configure do |c| | |
c.around(:each, :vcr) do |example| | |
name = example.metadata[:full_description].split(/\s+/, 2).join('/').underscore.gsub(%r{/[^\w\/]+/}, '_') | |
VCR.use_cassette(name) { example.call } | |
end | |
end | |
# Usage | |
# it 'should create a new credit card with given information', :vcr do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert -density 384 -background transparent logo.svg -format ico -resize 32x32 favicon.ico |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="carousel-container"> | |
<div class="carousel" id="my-carousel-id" carousel> | |
<!-- your templating engine for loop --> | |
<div class="carousel-slide"> | |
<img class="carousel-slide-background" src="one-image" alt="Image"> | |
<h1 class="carousel-slide-title">some title here</h1> | |
<p class="carousel-slide-subtitle">some subtitle here</p> | |
</div> | |
<!-- end for --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function URLParameters(str) { | |
this.queryString = typeof(str) === 'undefined' ? document.location.search : str; | |
this.params = {}; | |
this.parse = function(string) { | |
if (string && !_.isEmpty(string)) { | |
var obj = {}; | |
var pairs = string.replace('?', '').split('&'); | |
pairs = _.map(pairs, function(pair, index) { |