Skip to content

Instantly share code, notes, and snippets.

View tejastank's full-sized avatar

Tejas Tank tejastank

  • India
View GitHub Profile
@Xaekai
Xaekai / ipc.example.js
Created July 11, 2016 18:12
Example of Interprocess communication in Node.js through a UNIX domain socket
/*
**
** Example of Interprocess communication in Node.js through a UNIX domain socket
**
** Usage:
** server> MODE=server node ipc.example.js
** client> MODE=client node ipc.example.js
**
*/
@tejastank
tejastank / phonegap_install.sh
Created May 5, 2016 05:57 — forked from regdog/phonegap_install.sh
How to Install PhoneGap in Ubuntu 12.04 LTS
# 1. install java
# 2. install ant
# 3. install npm and nodejs
# 4. install android sdk
# 5. install phonegap
# 6. create a hello world phonegap app
# 7. lunch android avd(emulator)
# 8. run the app
# 9. add pluins
@aaira-a
aaira-a / google.py
Created April 8, 2016 00:54
python selenium google search example
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Firefox()
driver.get("http://www.google.com")
input_element = driver.find_element_by_name("q")
input_element.send_keys("python")
@xaedes
xaedes / circle-circle-intersection-points-python.py
Created March 6, 2016 15:15
circle-circle-intersection-points-python
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
from math import cos, sin, pi, sqrt, atan2
d2r = pi/180
class Geometry(object):
def circle_intersection(self, circle1, circle2):
<?php
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php');
include_once "google-api-php-client/examples/templates/base.php";
$client = new Google_Client();
/************************************************
ATTENTION: Fill in these values, or make sure you
have set the GOOGLE_APPLICATION_CREDENTIALS
@karlkranich
karlkranich / apitest.php
Last active July 17, 2018 14:49
Updated PHP code to use the Google Sheets API. See usage instructions at http://karl.kranich.org/2015/04/16/google-sheets-api-php/ More examples at https://gist.github.com/karlkranich/afa39e3d778455b38c38
<?php
// apitest.php
// by Karl Kranich - karl.kranich.org
// version 3.1 - edited query section
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php');
include_once "google-api-php-client/examples/templates/base.php";
$client = new Google_Client();
@adamtester
adamtester / wkhtmltopdf.sh
Last active April 12, 2019 16:58
Install wkhtmltopdf on Ubuntu 14.04+
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
sudo apt-get update
sudo apt-get install wkhtmltox
sudo apt-get -f install
sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
wkhtmltopdf -V
rm wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
@sirpercival
sirpercival / minimal_kivy.py
Created May 28, 2015 23:05
Minimal python & kivy script for spectral reduction
import fast_fits as extract
from datatypes import FitsImage, ExtractedSpectrum, Robust2D
import sys
from kivy.garden.graph import Graph, SmoothLinePlot
from custom_widgets import ImagePane
from kivy.base import runTouchApp
from image_arithmetic import im_divide, im_subtract
if __name__ == '__main__':
widget = ImagePane()
@sirpercival
sirpercival / datatable.py
Created March 30, 2015 13:18
DataTable widget for kivy
from kivy.lang import Builder
from kivy.uix.gridlayout import GridLayout
from kivy.properties import DictProperty, NumericProperty, StringProperty, \
BooleanProperty, ObjectProperty
from operator import itemgetter
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
from kivy.uix.label import Label
Builder.load_string("""
@jcupitt
jcupitt / watermark.py
Last active September 7, 2021 14:34
watermarking with vips8 python
#!/usr/bin/python3
import sys
import pyvips
im = pyvips.Image.new_from_file(sys.argv[1], access="sequential")
text = pyvips.Image.text(sys.argv[3], width=500, dpi=300, align="centre")
text = (text * 0.3).cast("uchar")
text = text.rotate(45)