This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Add this to the bottom of environment.rb | |
# | |
require 'smtp_tls' | |
ActionMailer::Base.delivery_method = :smtp | |
ActionMailer::Base.raise_delivery_errors = true | |
ActionMailer::Base.smtp_settings = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script language="JavaScript"> | |
<!-- | |
var name = "email"; | |
var domain = "mydomain.com"; | |
document.write('<a href=\"mailto:' + name + '@' + domain + '\">'); | |
document.write(name + '@' + domain + '</a>'); | |
//--> | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Define Variables | |
$host='localhost'; //hostname of database | |
$user='user'; //username of database | |
$pass='pass'; //password of database | |
$dbname='database'; //name of database | |
$table='table'; //name of table | |
$file='spreadsheet.csv'; //name of file to be imported (including extension) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DS_Store | |
log/*.log | |
tmp/**/* | |
db/schema.rb | |
!.keep | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Github Sunburst Syntax Highlight | |
// @namespace | |
// @description Textmate-style syntax highlighting for GitHub | |
// @include http://github.com/* | |
// @include https://github.com/* | |
// @include http://*.github.com/* | |
// @include https://*.github.com/* | |
// ==/UserScript== | |
(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### /config/environment.rb | |
config.gem 'fastercsv' | |
### /config/routes.rb | |
map.connect '/users/export', :controller => 'users', :action => 'export' | |
### /app/models/user.rb | |
# find all students and pass to controller export action for export to csv | |
def self.find_students | |
find_by_sql("select students.firstname, students.lastname, students.grade, students.homeroom, students.phone, students.email, students.relationship, users.firstname, users.lastname, accounts.school from students, users, accounts where students.user_id = users.id and accounts.id = users.account_id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xml = File.read("db/getLocationsForUrl.xml") | |
@doc = Nokogiri::XML.parse(xml) | |
locations = [] | |
locations.push("<option value=\"\">-- Select a Location --</option>") | |
@doc.xpath('/env:Envelope/env:Body/Array/item/return/item').each do |node| | |
id = node.xpath('id') | |
name = node.xpath('name') | |
locations.push("<option value=\"#{id.text}\">#{name.text}</option>") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/views/users/_results.html.haml | |
%table.table | |
- @users.each do |user| | |
%tr | |
%td | |
= h user.name | |
%td | |
= link_to 'Show', user | |
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.extend({ | |
getUrlVars: function(){ | |
var vars = [], hash; | |
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); | |
for(var i = 0; i < hashes.length; i++) | |
{ | |
hash = hashes[i].split('='); | |
vars.push(hash[0]); | |
vars[hash[0]] = hash[1]; | |
} |