Skip to content

Instantly share code, notes, and snippets.

View udithishara's full-sized avatar
🏠
Working from home

Udith Ishara Madusanka udithishara

🏠
Working from home
View GitHub Profile
"LD_* scout runtime" information:
{
"steam-runtime-system-info" : {
"version" : "0.20240806.0+srt1",
"path" : "/home/darknet/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin/steam-runtime-system-info"
},
"can-write-uinput" : false,
"steam-installation" : {
"path" : "/home/darknet/.local/share/Steam",
Computer Information:
Manufacturer: Dell Inc.
Model: 09RW31
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
CPU Family: 0x6
CPU Model: 0x8c
@udithishara
udithishara / vue-tel-input-customized.vue
Created September 19, 2023 14:52 — forked from danielsmykowski1/vue-tel-input-customized.vue
A vue-tel-input component that is customized to get the look-and-feel of Vuetify components.
<template>
<div :class="topContainerClasses">
<div
v-click-outside="clickedOutside"
:tabindex="dropdownOptions && dropdownOptions.tabindex ? dropdownOptions.tabindex : 0"
:class="['vti__dropdown', { open: open }]"
@keydown="keyboardNav"
@click="toggleDropdown"
@keydown.esc="reset"
>
// https://github.com/mubaidr/vue2-migration-helper
import {
ref,
reacted,
toRefs,
watch,
computed,
onCreated,
onMounted,
// From - https://xomisse.com/blog/how-to-add-numbered-pagination-to-blogger/
function pagination(a) {
var e = "";
leftnum = parseInt(numshowpage / 2), leftnum == numshowpage - leftnum && (numshowpage = 2 * leftnum + 1), start = postnumber - leftnum, start < 1 && (start = 1), maximum = parseInt(a / postperpage) + 1, maximum - 1 == a / postperpage && (maximum -= 1), end = start + numshowpage - 1, end > maximum && (end = maximum), e += "<span class='totalpages'>Page " + postnumber + " of " + maximum + "</span>";
var s = parseInt(postnumber) - 1;
postnumber > 1 && (e += 2 == postnumber ? "page" == type ? '<span class="showpage"><a href="' + home_page + '">' + prevpage + "</a></span>" : '<span class="pagenumber"><a href="/search/label/' + lblname1 + "?&max-results=" + postperpage + '">' + prevpage + "</a></span>" : "page" == type ? '<span class="pagenumber"><a href="#" onclick="redirectpage(' + s + ');return false">' + prevpage + "</a></span>" : '<span class="pagenumber"><a href="#" onclick="redi
@udithishara
udithishara / sheets-api-test-part2.php
Created November 20, 2015 05:02 — forked from karlkranich/sheets-api-test-part2.php
(obsolete due to Google changes) PHP code to use the Google Spreadsheets API with an OAuth Service Account. For more info, see http://karl.kranich.org/google-sheets-api-php
<?php
// Section 5: edit a row
// You'll need to get the etag and row ID, and send a PUT request to the edit URL
$rowid = 'cre1l'; // got this and the etag from the table data output from section 3
$etag = 'NQ8VCRBLVCt7ImA.';
$url = "https://spreadsheets.google.com/feeds/list/$fileId/od6/private/full/$rowid";
$method = 'PUT';
$headers = ["Authorization" => "Bearer $accessToken", 'Content-Type' => 'application/atom+xml', 'GData-Version' => '3.0'];
$postBody = "<entry xmlns=\"http://www.w3.org/2005/Atom\" xmlns:gsx=\"http://schemas.google.com/spreadsheets/2006/extended\" xmlns:gd=\"http://schemas.google.com/g/2005\" gd:etag='&quot;$etag&quot;'><id>https://spreadsheets.google.com/feeds/list/$fileid/od6/$rowid</id><gsx:gear>phones</gsx:gear><gsx:quantity>6</gsx:quantity></entry>";
$req = new Google_Http_Request($url, $method, $headers, $postBody);
@udithishara
udithishara / get_google_spreadsheet.php
Created November 18, 2015 06:46 — forked from uppfinnarjohnny/get_google_spreadsheet.php
A simple way of getting the data from a Google Docs Spreadsheet in PHP
<?php
function get_google_spreadsheet($key) {
$url = "https://spreadsheets.google.com/feeds/list/{$key}/od6/public/values";
$google_sheet = file_get_contents($url);
$xml = simplexml_load_string($google_sheet);
$data = array();
foreach($xml->entry as $entry) {
$row = array();
// The fields are in the gsx: namespace, so we need to specify that to be able to access them through SimpleXML.
@udithishara
udithishara / gspreadsheet.php
Created November 16, 2015 12:09 — forked from felladrin/gspreadsheet.php
Listing Google Spreadsheet answers with PHP (Parsing JSON)
<?php
$key = '0AsfENoKj1ir7dE8yR6U0aUtpdTVNM20wRlNJOhZaclG';
$json_string = file_get_contents("https://spreadsheets.google.com/feeds/list/$key/od6/public/values?alt=json");
$obj = json_decode($json_string);
foreach ($obj->{'feed'}->{'entry'} as $entry)
{
echo "<p>";
$num_column = 0;
$answer = explode(', ', $entry->{'content'}->{'$t'});
foreach ($answer as $a)
@udithishara
udithishara / example.html
Created November 16, 2015 12:09 — forked from rilinweb/example.html
Get Google Spreadsheet Data
<?php
$spreadsheetID = '1pO7BBOkhWL2TcBPYkDTlWZ0Gbw4mAUSadK_8NOn0Ij8';
$urlPath = 'http://spreadsheets.google.com/feeds/list/' . $spreadsheetID . '/od6/public/values?alt=json';
$file = file_get_contents($urlPath);
$json = json_decode($file);
$rows = $json->{'feed'}->{'entry'};
?>
<!DOCTYPE html>
<html lang="en">
<head>
@udithishara
udithishara / google-spreadsheet-reader.php
Created November 16, 2015 12:08 — forked from kosinix/google-spreadsheet-reader.php
Google spreadsheet reader in PHP
<?php
// URL to spreadsheet. Make sure to append ?alt=json to return contents in JSON format
$url = 'https://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json';
$file= file_get_contents($url);
$json = json_decode($file);
echo '<pre>'.print_r($json, 1).'</pre>';