Skip to content

Instantly share code, notes, and snippets.

View jdennes's full-sized avatar

James Dennes jdennes

View GitHub Profile
@jdennes
jdennes / controller-and-action-from-path.md
Last active April 3, 2023 15:03
Get the Rails controller and action given a path

Get the Rails controller and action from a given path/route

Given an application path like /github/github/issues, use the following to get the controller and action:

irb(main):001:0> Rails.application.routes.recognize_path "/github/github/issues", method: "GET"
=> {:controller=>"issues", :action=>"index", :user_id=>"github", :repository=>"github"}

The /github/github/issues path maps to issues#index (the index action on the IssuesController).

@prologic
prologic / LearnGoIn5mins.md
Last active February 12, 2025 06:52
Learn Go in ~5mins
@bkeepers
bkeepers / twithubbers.sh
Created June 4, 2013 14:29
Create a list of GitHubbers and follow all of them.
#!/bin/sh
#
# Requires the `t` gem: https://github.com/sferik/t
#
# gem install t
#
if [ -z $(t lists | grep -i githubbers) ]
then
t list create GitHubbers
@jdennes
jdennes / Procfile
Last active December 12, 2015 10:48
Another example Flask application to demonstrate authenticating with the Campaign Monitor API using OAuth. This example only uses the createsend and Flask packages.
web: python app.py
@jdennes
jdennes / Procfile
Last active December 31, 2021 09:24
Flask application to demonstrate authenticating with the Campaign Monitor API using OAuth. Uses the createsend, Flask, and Flask-OAuth packages.
web: python app.py
@jdennes
jdennes / Gemfile
Last active December 12, 2015 06:38
Rack application to demonstrate authenticating with the Campaign Monitor API using OAuth. Uses the sinatra, omniauth-createsend, and createsend gems.
source :rubygems
gem 'sinatra'
gem 'omniauth-createsend'
gem 'createsend'
@janl
janl / gist:3110170
Created July 14, 2012 09:23
CoUp Coffee Chemex Guide

Chemex Quick Guide

Not this is rocket sience :)

Water

Fill the water heater with a finger more than 1 liter of water. Set it on its power-base, hit the button that’s all the way out on the handle. This starts the heating process. Now hit the “minus” (“-”) button so you see a red light on the 90° marker. Let it heat up. In the meantime:

Beans

@Fitzsimmons
Fitzsimmons / spark.md
Created April 25, 2012 15:00 — forked from jesperfj/spark.md
Spark on Heroku

This guide will get you started using Spark on Heroku/Cedar. Spark is basically a clone of Sinatra for Java. 'Nuff said.

Create your app

Create a single Java main class in src/main/java/HelloWorld.java:

import static spark.Spark.*;
import spark.*;
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');