Skip to content

Instantly share code, notes, and snippets.

@himanshpal
himanshpal / gsheet_to_duckdb.py
Created March 3, 2026 08:01
DuckDB native gsheets extension: Read Google Sheets with pure SQL — supports base64 encoded service account JSON
"""
Read Google Sheets directly into DuckDB using the native gsheets extension.
No gspread, no pandaspure DuckDB SQL.
Prerequisites:
1. DuckDB >= 1.4.0
2. GCP Service Account with Google Sheets API enabled
3. Service account added to a Google Group (e.g., dataplatform@yourcompany.com)
4. Google Sheet shared with that Google Group (Viewer or Editor)
@himanshpal
himanshpal / main.go
Created January 7, 2018 17:45 — forked from 3n21c0/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@himanshpal
himanshpal / gist:da6ff3482d4eec1120ded32396cd90dc
Created June 24, 2016 09:02 — forked from dasgoll/gist:f5b294e0c9924900fc79
Cassandra CQL cqlsh supported version
[root@dev-etl apache-cassandra-2.2.3]# cd bin/
[root@dev-etl bin]# ./cqlsh cassandra1.kafkacluster100.com -u dwhuser -p 'password'
Connection error: ('Unable to connect to any servers', {'cassandra1.kafkacluster100.com': ProtocolError("cql_version '3.3.1' is not supported by remote (w/ native protocol). Supported versions: [u'3.3.0']",)})
[root@dev-etl bin]# ./cqlsh cassandra1.kafkacluster100.com -u dwhuser -p 'password' --cqlversion=3.3.0
Connected to kafkacluster100 at cassandra1.kafkacluster100.com:9042.
[cqlsh 5.0.1 | Cassandra 2.2.1 | CQL spec 3.3.0 | Native protocol v4]
Use HELP for help.
dwhuser@cqlsh>
@himanshpal
himanshpal / iTermColorsToTerminalColors.swift
Created March 6, 2016 08:44 — forked from leonbreedt/iTermColorsToTerminalColors.swift
Convert iTerm2 color scheme to Terminal.app color scheme. To use, just save to disk and run it like you would any script. NOTE: Needs Xcode 6.1 installed.
#!/usr/bin/xcrun swift
import AppKit
enum iTermColors: String {
case Ansi0 = "Ansi 0 Color"
case Ansi1 = "Ansi 1 Color"
case Ansi2 = "Ansi 2 Color"
case Ansi3 = "Ansi 3 Color"
case Ansi4 = "Ansi 4 Color"
@himanshpal
himanshpal / UIElementParallaxEffectBehavior.cs
Created January 23, 2016 14:16 — forked from jamesmcroft/UIElementParallaxEffectBehavior.cs
A simple parallax effect behavior which can be attached to scrolling UI elements
public class UIElementParallaxEffectBehavior : DependencyObject, IBehavior
{
public static readonly DependencyProperty ParallaxElementProperty =
DependencyProperty.Register(
"ParallaxElement",
typeof(UIElement),
typeof(UIElementParallaxEffectBehavior),
new PropertyMetadata(null, OnParallaxElementChanged));
public static readonly DependencyProperty ParallaxMultiplierProperty =
@himanshpal
himanshpal / gist:d463c9dc2c64a61e366e
Created December 20, 2015 07:23 — forked from phynet/Generate and Install IPA's file in device through Command Line.md
Generate and Install IPA's file in device through Command Line

##Generate and Install IPA's file in device through Command Line

###Thanks to Mattt and phonegap's scripts

Take a note: all this steps can be automatized in a single script, if you know how to write it. (Bash or Ruby will be fine)

1.- Install your Provisioning Profile and Developer Certificate

2.- Install Shenzhen and ios-deploy: the firstone will generate the IPA file and the secondone will install it onto your device

@himanshpal
himanshpal / LocationManager.cs
Created December 11, 2015 08:14
Location Manager WinRT 8.1 and UWP apps
public sealed class LocationManager : Interfaces.ILocationManager
{
private const string Key = "CurrentLocation";
private const uint DefaultAccuracyInMeters = 300;
private const double DefaultAccuracyRadius = 0.1; // In Meters
private readonly Geolocator _geolocator;
private const int AccessDeniedExceptionHResult = -2147024891;
public LocationManager()
{
@himanshpal
himanshpal / backend-architectures.md
Created October 31, 2015 21:02 — forked from ngocphamm/backend-architectures.md
Backend Architectures