Skip to content

Instantly share code, notes, and snippets.

View JaredCowan's full-sized avatar

Jared (woo wooo) Cowan JaredCowan

  • @mapleandbeam
  • Central Texas
View GitHub Profile
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 7, 2024 15:15
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@indiesquidge
indiesquidge / subdomain-localhost-rails-5.md
Created January 19, 2016 07:42
how to access subdomains locally with Rails 5

Subdomaining Localhost with Rails 5

I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api

Rails.application.routes.draw do
  constraints subdomain: "api" do
    scope module: "api" do
@jhohlfeld
jhohlfeld / gist:bc0ed726550192eb183d
Created June 12, 2015 08:10
Run different node.js versions on a Mac using homebrew

I suppose you already installed homebrew nad have one current version of node installed.

Reference taken from https://gist.github.com/kugaevsky/68a7fa894551da9c310a

First, add an older formula of node:

$ cd /usr/local
$ git checkout b64d9b9c431642a7dd8d85c8de5a530f2c79d924 Library/Formula/node.rb
$ brew unlink node
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@fadhlirahim
fadhlirahim / gist:1991616
Created March 7, 2012 07:23
rails return json for fullcalendar.js dates displays
# Model
class Meeting < ActiveRecord::Base
scope :date_range, lambda {|*args| where("start_date between ? and ?", args.first, args.last) }
end
#Controller
# fullcalendar.js dates displays
def meeting_dates
start_range = params[:start].present? ? Time.at(params[:start].to_i) : Date.civil(Time.now.year, Time.now.month, 1)
@cdmwebs
cdmwebs / friendly_urls.markdown
Created September 11, 2011 15:50 — forked from jcasimir/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@schleg
schleg / 01. Gemfile
Created May 26, 2011 17:26
Setup for Devise + Omniauth
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'