Skip to content

Instantly share code, notes, and snippets.

View abhyudayasrinet's full-sized avatar

Abhyudaya Srinet abhyudayasrinet

  • New Delhi, India
View GitHub Profile
from Google import Create_Service
CLIENT_SECRET_FILE = '<client secret.json>'
API_SERVICE_NAME = 'sheets'
API_VERSION = 'v4'
SCOPES = ['https://www.googleapis.com/auth/spreadsheets']
service = Create_Service(CLIENT_SECRET_FILE, API_SERVICE_NAME, API_VERSION, SCOPES)
gsheet_id = '<google sheet id>'
@bpanicker13
bpanicker13 / index.html
Created February 27, 2017 03:40
Simple Typing Carousel
<link href="http://fonts.googleapis.com/css?family=Raleway:200,100,400" rel="stylesheet" type="text/css" />
<h1>Build your own
<span
class="txt-rotate"
data-period="2000"
data-rotate='[ "eCommerce Site.", "Web Application.", "IoT Device.", "Blog." ]'></span>
</h1>
<h2>Create Your Awesome Website with Synoval.</h2>
@apolloclark
apolloclark / postgres cheatsheet.md
Last active March 22, 2025 13:50
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@mandiwise
mandiwise / Update remote repo
Last active March 22, 2025 05:41
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@nickretallack
nickretallack / joins.py
Last active May 21, 2023 22:18
How do I do a join without a real foreign key constraint?
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, ForeignKey, Integer, String, ForeignKeyConstraint
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, relationship
Model = declarative_base()
class Parent(Model):
__tablename__ = 'parent'
id = Column(Integer, primary_key=True)
@np1
np1 / gist:5653451
Last active December 17, 2015 18:29
Gtk get tree selection rownumber and contents #Python #Gtk #Treeview
def on_tree_selection_changed(self, selection):
model, treeiter = selection.get_selected()
if treeiter is not None:
rowcontents = model[treeiter][0:3] # for a 4 column treeview
rownumobj = model.get_path(treeiter)
rownum = int(rownumobj.to_string())
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@9re
9re / ExifUtil.java
Created March 7, 2012 00:16
fix flipped / rotated image by getting exif orientation
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.os.Build;
@otsaloma
otsaloma / gist:1912053
Created February 26, 2012 01:24
Line numbers in Gtk2 text view margin
#!/usr/bin/env python
import gtk
import pango
def on_text_view_expose_event(text_view, event):
text_buffer = text_view.get_buffer()
bounds = text_buffer.get_bounds()
text = text_buffer.get_text(*bounds)
nlines = text.count("\n") + 1
layout = pango.Layout(text_view.get_pango_context())
layout.set_markup("\n".join([str(x + 1) for x in range(nlines)]))
@wontoncc
wontoncc / balloontip.py
Last active November 18, 2024 01:04
Balloon tip module, Python, using win32gui.
# -- coding: utf-8 --
from win32api import *
from win32gui import *
import win32con
import sys, os
import struct
import time
class WindowsBalloonTip: