Skip to content

Instantly share code, notes, and snippets.

View imammubin's full-sized avatar

Imam Mubin imammubin

View GitHub Profile
@JurajBegovac
JurajBegovac / MIT License
Last active December 26, 2023 05:47
Implementation for SSE with ktor for KMM (kotlin mobile multiplatform). ktorVersion = "2.2.1" coroutinesVersion = "1.6.4"
MIT License
Copyright (c) 2022-2023 Juraj Begovac
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@usmanfarman
usmanfarman / MyGlass.php
Created October 12, 2013 18:46
Excerpts from two classes that I'm messing around with.
/**
* Download an attachment's content.
*
* @param string item_id ID of the timeline item the attachment belongs to.
* @param Google_Attachment $attachment Attachment's metadata.
* @return string The attachment's content if successful, null otherwise.
*/
function download_attachment($item_id, $attachment) {
$request = new Google_HttpRequest($attachment->getContentUrl(), 'GET', null, null);
$httpRequest = Google_Client::$io->authenticatedRequest($request);