This file contains hidden or 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
class Photo < ActiveRecord::Base | |
has_many :profiles | |
has_attached_file :photo, :styles => { :medium => "300x300", :large => "500x500", :thumb => "100x100" }, :s3_host_name => 's3-us-west-2.amazonaws.com' | |
validates_attachment_content_type :photo, :content_type => /\Aimage\/.*\Z/ | |
validates_with AttachmentSizeValidator, attributes: :photo, less_than: 5.megabytes | |
validates_attachment_presence :photo, presence: true |
This file contains hidden or 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
<style> | |
.dumb { | |
color: chartreuse; | |
background-color: red; | |
} | |
</style> | |
<!DOCTYPE html> | |
<html lang="en"> |
This file contains hidden or 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
import Devise from 'ember-simple-auth/authenticators/devise'; | |
export default Devise.extend({ | |
tokenAttributeName: 'authentication_token' | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
const { inject: { service }, RSVP } = Ember; | |
export default Ember.Service.extend({ | |
session: service(), | |
store: service(), | |
loadCurrentUser() { | |
return new RSVP.Promise((resolve, reject) => { |
This file contains hidden or 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
import Ember from 'ember'; | |
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin'; | |
const { service } = Ember.inject; | |
export default Ember.Route.extend({ | |
sessionAccount: service('session-account'), | |
beforeModel() { | |
return this._loadCurrentUser(); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
session: Ember.inject.service('session'), | |
sessionAccount: Ember.inject.service(), | |
actions: { | |
authenticate() { | |
let {email, password} = this.getProperties('email', 'password'); | |
this.get('session').authenticate('authenticator:devise', email, password) |
This file contains hidden or 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
{-# LANGUAGE OverloadedStrings #-} | |
module Lib where | |
import Text.HTML.Scalpel | |
import Data.Maybe (fromMaybe) | |
import Data.Char | |
import Control.Applicative | |
import Text.Read (readMaybe) |
This file contains hidden or 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
from talon import Context, actions | |
import webbrowser | |
ctx = Context("vim") | |
ctx.lists["self.commands"] = { | |
"change": "c", | |
"delete": "d", | |
"yank": "y", | |
"copy": "y", |
This file contains hidden or 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
package animator | |
import com.raquo.airstream.eventstream.EventStream | |
import com.raquo.airstream.signal.{Signal, Var} | |
import magnolia.{CaseClass, Magnolia} | |
import org.scalajs.dom | |
import scala.language.experimental.macros | |
object Time { |
This file contains hidden or 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
<template name="fr" value="for { $VARIABLE$ <- $VALUE$ } yield $FINISH$" description="for comprehension" toReformat="false" toShortenFQNames="true"> | |
<variable name="VALUE" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="VARIABLE" expression="" defaultValue=""x"" alwaysStopAt="true" /> | |
<variable name="FINISH" expression="" defaultValue="VARIABLE" alwaysStopAt="true" /> | |
<context> | |
<option name="SCALA" value="true" /> | |
</context> | |
</template> | |
<template name="FR" value="for { $VARIABLE$ <- $SELECTION$ } yield $FINISH$" description="for comprehension" toReformat="false" toShortenFQNames="true"> | |
<variable name="VARIABLE" expression="" defaultValue=""x"" alwaysStopAt="true" /> |