Skip to content

Instantly share code, notes, and snippets.

View dankozlowski's full-sized avatar
🌲
Steady in the storm!

Dan Kozlowski dankozlowski

🌲
Steady in the storm!
  • Portland, OR
View GitHub Profile
= form_for @user_comment do |f|
-if @user_comment.errors.any?
#error_explanation
%h2= "#{pluralize(@user_comment.errors.count, "error")} prohibited this user_comment from being saved:"
%ul
- @user_comment.errors.full_messages.each do |msg|
%li= msg
.field
= f.hidden_field :admin_id, :value => current_admin.id
<VirtualHost *:80>
ServerName 50.56.125.25
DocumentRoot /home/dan/family-legal-resources/live/public
<Directory /home/dan/family-legal-resources/live/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
2686 dan 20 0 170m 48m 1388 D 0 19.8 0:01.83 ruby
2708 dan 20 0 170m 47m 1388 D 0 19.6 0:01.85 ruby
2715 dan 20 0 170m 47m 1388 D 0 19.4 0:01.81 ruby
2701 dan 20 0 170m 47m 1388 D 0 19.3 0:01.83 ruby
2722 dan 20 0 170m 47m 1380 D 0 19.2 0:01.81 ruby
2694 dan 20 0 169m 21m 1136 D 0 8.6 0:01.54 ruby
2584 dan 20 0 157m 3496 140 S 0 1.4 0:11.37 ruby
.span-2 &nbsp;
.span-20
#gallery
= image_tag 'rails.png'
= image_tag 'david_logo.png'
:javascript
Galleria.loadTheme("#{root_path}/public/themes/classic/galleria.classic.min.js");
$("#gallery").galleria({
width: 500,
1.9.3-p0 :005 > ul = Upload.first
Upload Load (0.3ms) SELECT "uploads".* FROM "uploads" LIMIT 1
=> #<Upload id: 7, title: "Week 1", desc: "Filled in PowerPoint notes, week 1", student_id: 83, course_id: 1996, attachment: "1.ppt", created_at: "2011-10-03 18:40:39", updated_at: "2011-10-03 18:40:39", group_id: nil, uploadable_type: nil, uploadable_id: nil, lost: false>
1.9.3-p0 :006 > ul.lost = true
=> true
1.9.3-p0 :007 > ul.save
(0.2ms) BEGIN
(0.1ms) ROLLBACK
=> false
1.9.3-p0 :008 >
# I need factories in the console!
require 'factory_girl'
FactoryGirl.find_definitions
// Javascript that submits data:
function pushResults() {
$.ajax({
type : "POST",
url : "/mindfulness_tutor",
beforeSend: function(jqXHR, settings) {
jqXHR.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
},
dataType: "text/plain",
data : "stats=" + serialize(resultsArray) + "&total=" + totalMeditationTime,
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
# Defines a new sequence
FactoryGirl.define do
sequence :email do |n|
"person#{n}@example.com"
end
end
generate :email
# => "person1@example.com"
@dankozlowski
dankozlowski / install_ruby_rpi.sh
Created October 24, 2015 01:00 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.2 on the Raspberry Pi (Raspbian).
#!/bin/bash
# -----------------------------------------------------------------------
# Installs Ruby 2.2 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s raw_script_url_here)
# -----------------------------------------------------------------------
# Set up variables