Skip to content

Instantly share code, notes, and snippets.

View jonahgeorge's full-sized avatar

Jonah George jonahgeorge

View GitHub Profile
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 17, 2024 23:43
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@owainlewis
owainlewis / Example.hs
Last active June 1, 2020 20:30
Haskell HTTP GET request example
module Example () where
import Network.HTTP
-- Non HTTPS
-- 1. Perform a basic HTTP get request and return the body
get :: String -> IO String
get url = simpleHTTP (getRequest url) >>= getResponseBody
@davidgomes
davidgomes / How to change Pantheon Terminal's color scheme.md
Created March 14, 2013 16:53
How to change Pantheon Terminal's color scheme

How to change Pantheon Terminal's color scheme

Many of us spend many hours of our days using their terminal. Plus, we all have different tastes when it comes to color schemes. That's why the ability to change the color scheme of a terminal is one of its more important featuresl. Throughout this tutorial, I'll teach you how you can change the looks of your terminal, step by step.

This tutorial is aimed at elementary OS users, but it also works for any Ubuntu user. Start by installing dconf-tools:

sudo apt-get install dconf-tools

Secondly, you need to decide which theme you're going to apply. You can find dozens of terminal color schemes online, you can even design your own using this web application. Design the color scheme, hit "Get Scheme" and choose "Terminator". You'll get a raw text file with a background color, a foreground color and a palette. Those strings define your color scheme. In this tutorial, I'll post an

OSU Course Catalog API

Disclaimer

This is no where near finished and does not follow REST standards.

To get a listing of all subjects you can simply hit http://api.kylestevenson.me/subjects

{
  "subjects": [
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@grillermo
grillermo / .vimrc
Created March 6, 2015 17:50
Ctrlp using ag the silver searcher
"" The Silver Searcher
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" " ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
@vlakoff
vlakoff / OrderByRandomTrait.php
Created July 31, 2015 19:37 — forked from vluzrmos/HasRandomStatementTrait.php
Laravel Eloquent Agnostic Random Statement
<?php
trait OrderByRandomTrait
{
/**
* Scope to order by random.
*
* @param \Illuminate\Database\Query\Builder $query
* @return \Illuminate\Database\Query\Builder
*/
@jonahgeorge
jonahgeorge / test_gen.rb
Created September 19, 2015 23:18
Generates Capybara tests for the rails_admin index page for all models.
models = Dir.glob("*.rb")
def spec(model)
template = <<-END
scenario "#{model}" do
visit rails_admin.index_path(model_name: "#{model}")
page.status_code.must_equal 200
page.assert_current_path rails_admin.index_path(model_name: "#{model}")
end
@jonahgeorge
jonahgeorge / .gitignore
Last active January 30, 2016 19:24 — forked from Lewuathe/shift.py
Optimal assignment of GTAs to Courses via ILP
__pycache__