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 express = require('express'); | |
var router = express.Router(); | |
var passport = require('passport'); | |
var uaction = require('../models/uaction'); | |
/* GET home page. */ | |
router.get('/', uaction.index); | |
router.route('/register') | |
.get(uaction.registerGet) |
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
package database | |
import ( | |
"database/sql" | |
"time" | |
"github.com/lib/pq" | |
) | |
// DBUser is the main DB User |
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
package routes | |
import ( | |
"encoding/base64" | |
. "mobilebid/controllers" | |
"net/http" | |
"os" | |
db "mobilebid/database" |
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
package routes | |
import ( | |
"github.com/auth0/go-jwt-middleware" | |
"github.com/codegangsta/negroni" | |
jwt "github.com/dgrijalva/jwt-go" | |
"github.com/gorilla/mux" | |
. "mobilebid/controllers" | |
"net/http" | |
"encoding/base64" |
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
package controllers | |
import ( | |
"fmt" | |
"mobilebid/billable" | |
db "mobilebid/database" | |
"mobilebid/stripe" | |
"net/http" | |
"os" | |
"strconv" |
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
let conn = new WebSocket(ws_url); | |
function setAppStateHandler() { | |
AppState.addEventListener('change', cstate => { | |
if(cstate === 'active') { | |
connectWS() | |
} | |
}) | |
} |
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 { AppState } from 'react-native'; | |
import { setError, clearError } from '../reducers/error'; | |
import { updateEventStatus } from '../reducers/event_details'; | |
import { setAlert } from '../reducers/alert'; | |
import { ws_url } from '../api/urls'; | |
import handleOnMessage, { UPDATE_EVENT_DETAILS, SET_EVENT_STATUS } from './handleOnMessage'; | |
import * as r from '../scenes/scene_names/routes'; | |
import store from '../store/store'; | |
//Socket connection readyStates are integers that correlate to these values |
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
//GetTransactionsAndLinesForBidder hits the database 3 times. Let's make that fast. | |
func (db *DB) GetTransactionsAndLinesForBidder(bidderID int) ([]BidderTransaction, error) { | |
//Establish a waitgroup. This has 3 functions only. Add, Wait, and Done. You add to the WaitGroup and hit Done when you are | |
// done with a process. It will stop the function at Wait until the WaitGroup is at 0. | |
var wg sync.WaitGroup | |
//Get the transaction 'shell' | |
trans, err := db.GetTransactionsForBidder(bidderID) | |
if err != nil { |
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
package main | |
/* | |
This isn't meant to be the idiomatic way to read files and copy them - this is a learning exercise | |
for myself. I wanted to be able to read multiple chunks of a file and write them concurrently to a | |
new file | |
I don't really handle all errors with log.Fatalln. It's just done here in the interest of keeping the focus on concurrency. | |
Example output: |
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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
//initialize an array with len/cap 6 | |
a := [6]string{"G", "o", "l", "a", "n", "g"} |
OlderNewer