Skip to content

Instantly share code, notes, and snippets.

View VirtuosiMedia's full-sized avatar

Virtuosi Media VirtuosiMedia

View GitHub Profile
@VirtuosiMedia
VirtuosiMedia / gist:3680424
Created September 8, 2012 22:33
Floating Square
.floatingSquare {
background: #FFF;
display: block;
height: 100px;
left: 45%;
opacity: 0.5;
position: absolute;
top: 45%;
width: 100px;
}
@VirtuosiMedia
VirtuosiMedia / User.php
Created September 8, 2012 21:43
An example file for working with users.
<?php
/**
* @author Benjamin Kuker
* @description A simple user class. Normally, this would interact with a database and form validation code, but for
* demonstration purposes, I'm simply throwing exceptions when errors occur.
*
* Also, please note: I rarely, if ever, use static methods or classes because they aren't easily testable or
* extensible and I almost always want to work with an object. If I were to need a static method, I would implement a
* function instead. See http://stackoverflow.com/questions/1185605/ for more. Because I probably wouldn't use it in
* real life, and in order to give you a more accurate picture of how I code, I've ommitted the static method.
(function($) {
$.widget("ui.demographics_filter", {
_initialize: function(){
this.getFilters();
this._wire();
},
_wire: function(){
var self = this;
$('.btn-group').click(function(){
def format_data
tasks = self.task_completions.select(
"task_completions.skipped,
task_completions.created_at,
task_completions.timestamp,
demographics.gender,
demographics.age,
demographics.location,
demographics.ethnicity,
demographics.income,
//Create URL slug
var urlText = new Element('a', {
'href':'#',
'id':'fullUrlToggle',
'html':$('viewFullUrl').get('value')
});
$('urlLabel').appendText(' ').grab(urlText);
$('fullUrlToggle').addEvent('click', function(e){
e.stop();
var Hyphenator = new Class ({
Implements: [Events, Options],
options: {
separator: '-',
trigger: 'keyup',
prepend: '',
allowed: /[^\w\d\s-]/g
},
def all
if current_user.has_projects?
@trial = current_user.trials.first
@project = @trial.project
else
@trial = Trial.new
@project = current_user.projects.first
end
@is_new = params[:new]
def update
@admin = Admin::Admin.find(params[:id])
respond_to do |format|
if params[:admin_admin][:change_password]
#call update_password here
else
if @admin.update_attributes(params[:admin_admin])
flash[:success] = "'#{@admin.name}' was successfully updated."
format.html { redirect_to admin_admins_path }
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
require 'spec_helper'
require "selenium/client"
require "selenium-webdriver"
describe "Pricing Page Exists" do
attr_reader :selenium_driver
alias :page :selenium_driver
before(:all) do
@verification_errors = []