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 SelfCollectStation | |
| def self.update_or_create(params) | |
| station = detect_or_initialize_by(extension_id: attributes[:extension_id]) | |
| if station.persisted? | |
| station.update(attributes) | |
| else | |
| station.save | |
| end | |
| end |
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
| Sidekiq.redis { |conn| conn.flushdb } |
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
| //AuthRoute.js snippet | |
| import React from 'react'; | |
| import { Route, Redirect } from 'react-router-dom'; | |
| class AuthRoute extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.authenticated = this.authenticated.bind(this); | |
| } |
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
| require 'rails_helper' | |
| RSpec.describe Piece, type: :model do | |
| let!(:user) { FactoryGirl.create(:user) } | |
| let!(:game) { FactoryGirl.create(:game, user_id: user.id)} | |
| let!(:piece) { FactoryGirl.create(:piece, x_pos: 3, y_pos: 3, user_id: user.id, game_id: game.id) } | |
| describe "#right_or_left" do | |
| subject(:right_or_left) { piece.right_or_left(destination_x) } |
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 main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| "os" | |
| ) | |
| func main() { |
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
| // this is the simple tab snippet to render. | |
| render() { | |
| return ( | |
| <Tabs justified={true}> | |
| <Tab value="pane-1" label="Tab 1">Pane-1</Tab> | |
| {this.newInstanceTab(false)} | |
| </Tabs> | |
| ); | |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| WORK=/var/folders/h9/m85f0f9x047dbq00dhgq411w0000gn/T/go-build961820340 | |
| mkdir -p $WORK/github.com/carlqt/geodude/models/_obj/ | |
| mkdir -p $WORK/github.com/carlqt/geodude/ | |
| cd /Users/carlwilliamtablante/Projects/Go/src/github.com/carlqt/geodude/models | |
| /usr/local/Cellar/go/1.6.3/libexec/pkg/tool/darwin_amd64/compile -o $WORK/github.com/carlqt/geodude/models.a -trimpath $WORK -p github.com/carlqt/geodude/models -complete -buildid 8e77d3dc73c8d9cd4539660467763416273c1e37 -importmap github.com/lib/pq=github.com/carlqt/geodude/vendor/github.com/lib/pq -importmap github.com/shopspring/decimal=github.com/carlqt/geodude/vendor/github.com/shopspring/decimal -importmap golang.org/x/crypto/bcrypt=github.com/carlqt/geodude/vendor/golang.org/x/crypto/bcrypt -importmap gopkg.in/yaml.v2=github.com/carlqt/geodude/vendor/gopkg.in/yaml.v2 -D _/Users/carlwilliamtablante/Projects/Go/src/github.com/carlqt/geodude/models -I $WORK -I /Users/carlwilliamtablante/Projects/Go/pkg/darwin_amd64 -pack ./db.go ./property.go ./user.go | |
| mkdir -p $ |
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 properties | |
| import( | |
| "github.com/shopspring/decimal" | |
| "github.com/gin-gonic/gin" | |
| "github.com/fatih/color" | |
| "github.com/carlqt/geodude/geocode" | |
| "net/http" | |
| "strconv" | |
| "github.com/carlqt/geodude/models" |
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 main | |
| import ( | |
| "fmt" | |
| "github.com/carlqt/geodude/controllers/properties" | |
| "github.com/carlqt/geodude/controllers/user" | |
| "github.com/carlqt/geodude/geocode" | |
| "github.com/carlqt/geodude/models" | |
| "github.com/dgrijalva/jwt-go" |
NewerOlder