How to Logout of an Application Where I Used OAuth2 To Login With Google?

Overview of OAuth: Is the User Who He/She Says He/She is?: I’m not sure if you used OAuth to login to Stack Overflow, like the “Login with Google” option, but when you use this feature, Stack Overflow is simply asking Google if it knows who you are: “Yo Google, this Vinesh fella claims that vinesh.e@gmail.com … Read more

How to use API Routes in Laravel 5.3

You call it by http://localhost:8080/api/test ^^^ If you look in app/Providers/RouteServiceProvider.php you’d see that by default it sets the api prefix for API routes, which you can change of course if you want to. protected function mapApiRoutes() { Route::group([ ‘middleware’ => ‘api’, ‘namespace’ => $this->namespace, ‘prefix’ => ‘api’, ], function ($router) { require base_path(‘routes/api.php’); }); … Read more

Stock ticker symbol lookup API [closed]

You can use yahoo’s symbol lookup like so: http://d.yimg.com/autoc.finance.yahoo.com/autoc?query=yahoo&callback=YAHOO.Finance.SymbolSuggest.ssCallback Where query is the company name. You’ll get something like this in return: YAHOO.Finance.SymbolSuggest.ssCallback( { “ResultSet”: { “Query”: “ya”, “Result”: [ { “symbol”: “YHOO”, “name”: “Yahoo! Inc.”, “exch”: “NMS”, “type”: “S”, “exchDisp”: “NASDAQ” }, { “symbol”: “AUY”, “name”: “Yamana Gold, Inc.”, “exch”: “NYQ”, “type”: “S”, “exchDisp”: … Read more

How exactly to use Notification.Builder

Notification.Builder API 11 or NotificationCompat.Builder API 1 This is a usage example. Intent notificationIntent = new Intent(ctx, YourClass.class); PendingIntent contentIntent = PendingIntent.getActivity(ctx, YOUR_PI_REQ_CODE, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT); NotificationManager nm = (NotificationManager) ctx .getSystemService(Context.NOTIFICATION_SERVICE); Resources res = ctx.getResources(); Notification.Builder builder = new Notification.Builder(ctx); builder.setContentIntent(contentIntent) .setSmallIcon(R.drawable.some_img) .setLargeIcon(BitmapFactory.decodeResource(res, R.drawable.some_big_img)) .setTicker(res.getString(R.string.your_ticker)) .setWhen(System.currentTimeMillis()) .setAutoCancel(true) .setContentTitle(res.getString(R.string.your_notif_title)) .setContentText(res.getString(R.string.your_notif_text)); Notification n = builder.build(); nm.notify(YOUR_NOTIF_ID, n);

Has Facebook sharer.php changed to no longer accept detailed parameters?

Facebook no longer supports custom parameters in sharer.php The sharer will no longer accept custom parameters and facebook will pull the information that is being displayed in the preview the same way that it would appear on facebook as a post from the url OG meta tags. Use dialog/feeds instead of sharer.php https://www.facebook.com/dialog/feed? app_id=145634995501895 &display=popup&caption=An%20example%20caption … Read more

Docker-compose up : Error while fetching server API version: (‘Connection aborted.’, ConnectionRefusedError(61, ‘Connection refused’))

Add your user to docker group and try again. sudo gpasswd -a $USER docker newgrp docker If you still have the problem, you may try after logging out and login back, or reboot. Or simply do: sudo su $USER Note: this may also happens if docker is not running on your machine. For linux with … Read more

PHP file_get_contents() returns “failed to open stream: HTTP request failed!”

Try using cURL. <?php $curl_handle=curl_init(); curl_setopt($curl_handle, CURLOPT_URL,’http://###.##.##.##/mp/get?mpsrc=http://mybucket.s3.amazonaws.com/11111.mpg&mpaction=convert format=flv’); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_USERAGENT, ‘Your application name’); $query = curl_exec($curl_handle); curl_close($curl_handle); ?>

Call another rest api from my server in Spring-Boot

This website has some nice examples for using spring’s RestTemplate. Here is a code example of how it can work to get a simple object: private static void getEmployees() { final String uri = “http://localhost:8080/springrestexample/employees.xml”; RestTemplate restTemplate = new RestTemplate(); String result = restTemplate.getForObject(uri, String.class); System.out.println(result); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)