So now I can log from anywhere in the application by saying:
MyPlugin.logger.debug("This is a debug level statement")
which outputs:
DEBUG This is a debug level statement
" Usage: | |
" | |
" :Me ~/path/to/my/new/file.txt | |
" | |
" creates /home/username/path/to/my/new with `mkdir -p` if it doesn't exist | |
" and then opens file.txt | |
" | |
function! Mkdire(path) | |
let l:newpath = fnamemodify(expand(a:path), ":p:h") |
So now I can log from anywhere in the application by saying:
MyPlugin.logger.debug("This is a debug level statement")
which outputs:
DEBUG This is a debug level statement
# https://github.com/ryanb/cancan | |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
# All abilities are scoped to roles | |
if user.is? :admin | |
# can :do, Stuff | |
end |
" http://vimgolf.com/challenges/4d1a34ccfa85f32065000004 | |
noremap E yypjddjj | |
" http://vimgolf.com/challenges/4d1a4d82a860b7447200008d | |
noremap <silent> <leader>v mv:%s/\s\+$//e<CR>:%s/\t/ /e<CR>`v | |
" this one was already in my .vimrc |
#left-column | |
!left_columns = floor(!blueprint_grid_columns / 2) | |
+column(!left_columns) | |
#right-column | |
!right_columns = ceil(!blueprint_grid_columns / 2) | |
+column(!right_columns) |
# before: gem install socrata | |
require 'socrata' | |
sapi = Socrata.new :base_uri => "http://data.baltimorecity.gov/api" | |
puts sapi.view("n4ma-fj3m") # Parking Citations |
#!/usr/bin/env ruby | |
require 'open-uri' | |
puts "<html><head></head><body><ul>" | |
while line = gets | |
gemname = line.chomp | |
url = "http://rubygems.org/gems/%s" % gemname | |
success = false |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> | |
<!-- from: https://github.com/tuupola/jquery_lazyload --> | |
<script src='https://github.com/tuupola/jquery_lazyload/raw/master/jquery.lazyload.js'></script> | |
<script> | |
$(function () { |
# proxying through apache to a local rails instance, http & https | |
# apache *.conf file | |
<VirtualHost *:80> | |
ServerName psl.localhost | |
ServerAlias cms.psl.localhost | |
ServerAlias *.psl.localhost | |
ProxyPass / http://localhost:3000/ | |
ProxyPassReverse / http://localhost:3000/ |
# there are two players, player A and player B | |
# the board has nine empty spaces, three by three grid | |
# game starts with player A | |
# game continues with players alternating turns making marks in spaces until game ends | |
# a legal move is when a player puts a mark in an empty space | |
# the game ends when either there have been nine moves or tictactoe has been acheived | |
#player = A or B | |
# there are two players, a and b |