Skip to content

Instantly share code, notes, and snippets.

View gnsx's full-sized avatar

Kevin D'Souza gnsx

View GitHub Profile
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@gnsx
gnsx / Unity3D_Android_Sharing_Text.cs
Last active October 30, 2018 08:51
C# script for Unity to share via Android
/*
Credit:
https://medium.com/@agrawalsuneet/native-android-text-sharing-in-unity-app-23f7f8e69978
*/
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class NativeTextShare : MonoBehaviour {
@gnsx
gnsx / pg.go
Created October 17, 2018 08:17 — forked from itang/pg.go
golang + postgreSQL example
package main
import (
"database/sql"
"fmt"
"log"
// load postgres driver
_ "github.com/lib/pq"
)
@gnsx
gnsx / go-smtp.go
Last active April 22, 2021 01:55
go-smtp.go
package main
import (
"fmt"
"github.com/go-gomail/gomail"
)
func main () {
fmt.Printf("Hello")
m := gomail.NewMessage()
@gnsx
gnsx / ffmpeg_opencv.py
Created July 21, 2017 18:40 — forked from eruffaldi/ffmpeg_opencv.py
Feeding Python Opencv with FFmpeg
#
# Reading video from FFMPEG using subprocess - aka when OpenCV VideoCapture fails
#
# 2017 note: I have realized that this is similar to moviepy ffmpeg reader with the difference that here we support YUV encoding
# BUT we lack: bufsize in POpen and creation flags for windows
# https://github.com/Zulko/moviepy/blob/master/moviepy/video/io/ffmpeg_reader.py
#
# Emanuele Ruffaldi 2016
import cv2
import subprocess
package main
import (
"fmt"
"gocsv"
"os"
"math"
"time"
"strconv"
"encoding/json"
@gnsx
gnsx / DateTime difference Calculator in JS
Last active March 29, 2016 08:35
JS Code to calculate difference between two time-stamps. Reference : http://stackoverflow.com/questions/1787939/check-time-difference-in-javascript
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Leaflet Label</title>
</head>
<body>
<script>