Skip to content

Instantly share code, notes, and snippets.

View kamathln's full-sized avatar

Laxminarayan G Kamath A kamathln

View GitHub Profile
#! /usr/bin/env python
# simple 2 finger gesture recognition for synaptic touchpad
# understand north, east, west, south, NE, NW, SE, SW
#
# if you have compiz installed with dbus plugin, then this script controls compiz too.
# depends on synclient command. you will need to have it on your machine
# USAGE:
# synclient -m 20 |python synaptic_gesture_compiz.py
import sys
#!/usr/local/bin/python3
import re
from urllib.request import urlopen, Request
from urllib.error import HTTPError
def get_page(urlstring):
"""
Arguments:
@kamathln
kamathln / seccam.py
Last active March 19, 2016 12:55
Raspberry Pi USB WebCamera Recording for security timelapse *Without much CPU overhead*
# Copyright (c) 2016 Laxmianarayan G Kamath A [email protected]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@kamathln
kamathln / rpi2numpy.py
Last active March 22, 2016 05:38
picamera to Numpy : File like helper class to read an image from picamera into numpy ndarray , usefull for image processing, especially with opencv
# Copyright (c) 2016 Laxmianarayan G Kamath A [email protected]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#!/bin/python3
#The MIT License (MIT)
#Copyright (c) 2017 "Laxminarayan Kamath G A"<[email protected]>
#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
@kamathln
kamathln / tray.py
Last active July 4, 2020 19:18
System tray icon for shell scripts et al. Interface to python pystray library.
#!/usr/bin/python3
# The MIT License (MIT)
# Copyright (c) 2017 "Laxminarayan Kamath G A"<[email protected]>
# 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
@kamathln
kamathln / p4a-build.bash
Last active October 13, 2018 23:40
p4a compile-install-run-debug cycle
#!/bin/bash
# Copyright (c) 2017 Laxminarayan Kamath<[email protected]>
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# This script eases the compile-install-run-debug cycle of
# python-for-android or Android kivy apps. Once configured and
# executed with proper command line options, it waits for your
# command. Single letter commands (at least for now) fire
# compiling, installing to phone, running on phone, and
@kamathln
kamathln / OneToOneMap.java
Last active January 13, 2018 07:13
One to One Mapping in Java
import java.util.HashMap;
import java.util.Map;
/**
* Created by [email protected] on 9/1/18.
*
* Preliminary idea .. not all Map related stuff are implemented.
* Tested with a Long and Integer.
*
* if new value value is set for a key, in addition to updating key->value mapping,
@kamathln
kamathln / unhandledjson.txt
Created April 9, 2019 17:07
Jsonc not parsing, no error
{
/*
jsonc example
hit Format and check the json output
*/
// forgiving syntax
hey: [this needs no commas]
// unquoted values