Skip to content

Instantly share code, notes, and snippets.

View tylerjohnst's full-sized avatar
:fishsticks:

Tyler Johnston tylerjohnst

:fishsticks:
  • GitHub Staff
  • Saint Petersburg, FL
View GitHub Profile
def create
@user = User.find_by_email params[:email]
if @user && @user.valid_password?(password)
return redirect_to_oauth_complete(@user.account) if oauth_session?
sign_in @user
redirect_to [:dashboard]
else
flash[:error] = 'You have entered an invalid email or password. Please try again.'
render :new
/script PlayerFrame:ClearAllPoints()
/script PlayerFrame:SetPoint("RIGHT", UIParent, "CENTER", -250, 250)
/run PlayerFrame:SetUserPlaced(true)
/script TargetFrame:ClearAllPoints()
/script TargetFrame:SetPoint("LEFT", PlayerFrame, "RIGHT", 20, 0)
/run TargetFrame:SetUserPlaced(true)
/script FocusFrame:ClearAllPoints()
/script FocusFrame:SetPoint("TOP", PlayerFrame, "BOTTOM", 50, 0)
@tylerjohnst
tylerjohnst / select.scss
Last active August 29, 2015 14:21
Modern browser compatible select styling with bootstrap 3
select.form-control {
-webkit-appearance: none;
-moz-appearance: none;
background-color: #fff;
background-image: url("select.png");
background-repeat: no-repeat;
background-position: right center;
padding-right: 30px;
&:-moz-focusring {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>FRP Infinite Scroll using Bacon.js</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.53/Bacon.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.7.0/lodash.min.js"></script>
<style type="text/css">
body {
class Foo
def self.foo=(value)
@foo = value
end
def self.foo
@foo
end
end
@tylerjohnst
tylerjohnst / one.clj
Last active August 29, 2015 14:06
Project Euler #1
(ns problems.one)
(defn- multiple-of [num x] (zero? (mod x num)))
(defn- multiples-of-three-and-five [x]
(or (multiple-of 3 x)
(multiple-of 5 x)))
(defn- real-numbers-below [x] (range 1 x))
(defn multiples-of-three-and-five-below [x]
@tylerjohnst
tylerjohnst / phonegap_back_button_mixin.js
Created August 25, 2014 13:56
Ember bindings for using phonegap events
App.PhonegapBackbuttonMixin = Ember.Mixin.create({
activate: function () {
this.get('phonegapProxy').on('backbutton', this, this.goBack);
},
deactivate: function() {
this.get('phonegapProxy').off('backbutton', this, this.goBack);
},
});
window.I18n = {
pushDictionary: function(translations) {
I18n.translations = Ember.Object.create(translations);
},
t: function(key, opts) {
var translation = I18n.translations.get('en.' + key);
opts = opts || {};
App.PaginationMixin = Ember.Mixin.create({
// Define a property called "paginate" that returns the collection to paginate.
currentPage: 0,
perPage: 15,
collectionSize: Ember.computed.alias('paginate.length'),
actions: {
setPage: function(pageNumber) {