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
#commit models | |
class Commit < ActiveRecord::Base | |
attr_accessible :commit_url, :author, :commit_message | |
set_inheritance_column :provider | |
end | |
class GithubCommit < Commit | |
end | |
#story model | |
class Story < ActiveRecord::Base |
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
module.exports = { | |
ValidationError: class extends Error{ | |
constructor(message){ | |
super(message || "This input is invalid") | |
} | |
}, | |
DatabaseError: class extends Error { | |
constructor(message){ | |
super(message || "The database call failed") | |
} |
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
validator = new Validator({ | |
presence: ['address', 'email', 'password', 'password_confirmation'], | |
regex: { | |
email: '[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}' | |
}, | |
length: { | |
password: '> 10', | |
password_confirmation: '> 10' | |
}, | |
custom: [ |
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
main = | |
Navigation.program Types.UrlChange | |
{ init = Update.init | |
, view = Views.view | |
, update = Update.update | |
, subscriptions = subscriptions | |
} | |
-- Subscriptions |
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
import Html exposing (..) | |
import Html.Attributes as Attr | |
import Html.Events as Evt exposing (onClick) | |
import Html.Events.Extra as Evte | |
import Html.Keyed as Keyed | |
import Material | |
{- Program -} | |
main = | |
Html.program |
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
import Html exposing (..) | |
import Html.Attributes as Attr | |
import Html.Events exposing (onClick) | |
main = | |
Html.program | |
{ init = (initialModel, Cmd.none) | |
, view = view | |
, update = update |
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
$(document.ready(){ | |
$('add-button').click(function(e){ | |
$('ingredients-div-form-inputs').append('<input type="text" name="ingredients[]">') | |
}) | |
}) |
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
var email = require('email-anonymizer')({ | |
domain: 'xyz.com', | |
}) | |
email.send({ | |
'from': 'seangregory@protonmail.com', | |
'to': 'seanchristophergregory@gmail.com', | |
'body': 'hello world' | |
}) | |
.then((response) => { |
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
$new_array = array(); | |
foreach($array as $vehicle_id) { | |
if(isset($new_array[$vechicle_id])) { | |
$new_array[$vehicle_id] += 1; | |
} else { | |
$new_array[$vehicle_id] = 1; | |
} | |
} | |
function sum($carry, $vehicle_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
// It's never easy to say goodbye | |
var goodbye = function(){ | |
// to the faces | |
let to = function(faces=[]){ | |
if( faces && Array.isArray(faces) && faces.length > 1 ) { |
OlderNewer