Skip to content

Instantly share code, notes, and snippets.

View benphelps's full-sized avatar
🇺🇦
Slava Ukrayini!

Ben Phelps benphelps

🇺🇦
Slava Ukrayini!
View GitHub Profile
@benphelps
benphelps / notes.txt
Created March 30, 2014 02:23
Nginx + Passenger
apt-get update
adduser rails
usermod -a -G sudo rails
sudo apt-get update
curl -L get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo 'gem: --no-document' >> .gemrc
rvm requirements
rvm install ruby-2.1.1
Refused to evaluate a string as CSS because 'unsafe-eval' is not an allowed source of style in the following Content Security Policy directive: "style-src 'self' 'unsafe-inline' https://github.global.ssl.fastly.net".
frameworks-1eb4805d296158ea875ffc5fa959a11f5a3cdf13.js:2
Uncaught SecurityError: Failed to set the 'cssText' property on 'CSSStyleDeclaration': Refused to evaluate a string as CSS because 'unsafe-eval' is not an allowed source of style in the following Content Security Policy directive: "style-src 'self' 'unsafe-inline' https://github.global.ssl.fastly.net".
frameworks-1eb4805d296158ea875ffc5fa959a11f5a3cdf13.js:2
Uncaught ReferenceError: $ is not defined github-664dd42b46e39e8d81e9697f401ff29614a14b50.js:1
Refused to evaluate a string as CSS because 'unsafe-eval' is not an allowed source of style in the following Content Security Policy directive: "style-src 'self' 'unsafe-inline' https://github.global.ssl.fastly.net".
jquery.js:2
Uncaught SecurityError: Failed to set the 'cssText' property
- if @sessions.count == 0
%tr
%td.secondary{colspan: 2} You have no sessions.
- @sessions.each do |session|
%tr
%td= session.ip_address
%td= session.expires.to_s(:distance)
@import url("//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700");
/*!
* Bootswatch v3.1.1
* Homepage: http://bootswatch.com
* Copyright 2012-2014 Thomas Park
* Licensed under MIT
* Based on Bootstrap
*/
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
html {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bootstrap Test</title>
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.min.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div class="container">
<!-- STUFF HERE START -->
class Ticket < ActiveRecord::Base
include AASM
belongs_to :user
has_many :messages
attr_accessor :message
class AuthController < ApplicationController
def index
user = User.find_for_authentication(:email => params[:email])
if user.valid_password?(params[:password])
if user.try?(:session) # check for session
session = user.session
if session.expires > Date.new # session has expired, refresh
session.ip_address = request.remote_ip
session.expires = Time.now + 30.minutes
%h2 Sign In
- form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
.row
.col-xs-12.col-md-6.col-lg-6
.form-group
= f.label :email
= f.email_field :email, :autofocus => true
.col-xs-12.col-md-6.col-lg.6
.form-group
### Keybase proof
I hereby claim:
* I am benphelps on github.
* I am phelps (https://keybase.io/phelps) on keybase.
* I have a public key whose fingerprint is DD83 6806 DD26 D81B 052C 522F 9DF0 26D9 6A84 7392
To claim this, I am signing this object:
@benphelps
benphelps / sodasavings.txt
Last active August 29, 2015 13:56
Savings when using a SodaStream to make your own RedBull.
## SodaStream RedBull Breakdown
Everything has been rounded, actual savings will be slightly better.
Online Wal-Mart prices with 9.5% tax.
----------------------------------------------------
$ 7.65 - SodaStream Energy Syrup per 10 liters
x 6 - Syrups per 60 L