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
function db_query($query) | |
{ | |
$result = mysql_query($query) or sql_error($query); | |
return $result; | |
} | |
function sql_error($query) | |
{ | |
$message = "DATABASE ERROR \n QUERY: $query \n ERROR: " . mysql_error(); | |
$out = '<hr><strong>DATABASE ERROR</strong><hr><pre><p><div><em>The query was</em> : </div><div>' . htmlentities($query) . '</div></p><p><div><em>MySQL Said</em> : </div><div>' . mysql_error() . '</div></p></pre><hr>'; |
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
angular.module('stateMock',[]); | |
angular.module('stateMock').service("$state", function($q){ | |
this.expectedTransitions = []; | |
this.current = {}; | |
this.transitionTo = function(stateName){ | |
if(this.expectedTransitions.length > 0){ | |
var expectedState = this.expectedTransitions.shift(); | |
if(expectedState !== stateName){ | |
throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName ); | |
} |
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
<?php | |
use Laravel\Socialite\Two\AbstractProvider; | |
use Laravel\Socialite\Two\ProviderInterface; | |
use Laravel\Socialite\Two\User; | |
class SpotifyProvider extends AbstractProvider implements ProviderInterface { | |
} |
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
<?php | |
namespace FestivalPlaylists\Oauth; | |
use Laravel\Socialite\Two\AbstractProvider; | |
use Laravel\Socialite\Two\ProviderInterface; | |
use Laravel\Socialite\Two\User; | |
class SpotifyProvider extends AbstractProvider implements ProviderInterface |
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
/** | |
* Scopes | |
* | |
* @var string | |
*/ | |
const SCOPE_PLAYLIST_MODIFY_PUBLIC = 'playlist-modify-public'; | |
const SCOPE_PLAYLIST_MODIFY_PRIVATE = 'playlist-modify-private'; | |
const SCOPE_PLAYLIST_READ_PRIVATE = 'playlist-read-private'; | |
const SCOPE_STREAMING = 'streaming'; | |
const SCOPE_USER_LIBRARY_MODIFY = 'user-library-modify'; |
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
return [ | |
'spotify' => [ | |
'client_id' => 'CLIENT_ID_STR', | |
'client_secret' => 'CLIENT_SEC_STR', | |
'redirect' => getenv('URL') . '/login' | |
] | |
]; |
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
private function bootSpotifySocialite() | |
{ | |
$socialite = $this->app->make('Laravel\Socialite\Contracts\Factory'); | |
$socialite->extend( | |
'spotify', | |
function ($app) use ($socialite) { | |
$config = $app['config']['services.spotify']; | |
return $socialite->buildProvider(SpotifyProvider::class, $config); | |
} | |
); |
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
public function redirectToProvider() | |
{ | |
return Socialize::with('spotify')->redirect(); | |
} | |
public function handleProviderCallback() | |
{ | |
$user = Socialize::with('spotify')->user(); | |
// $user->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
$router->get('login', ['as' => 'login', 'uses' => 'SpotifyAuthController@redirectToProvider']); | |
$router->get('login_callback', ['as' => 'login', 'uses' => 'SpotifyAuthController@handleProviderCallback']); |
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
elixir(function(imix) { | |
// Workflow stuff | |
imix.sass('app.scss') | |
.coffee() | |
.phpUnit() | |
.wiredep(); | |
// Build stuff | |
if (elixir.config.production) { | |
imix.stylesIn('public/css') | |
.scriptsIn('public/js') |
OlderNewer