Skip to content

Instantly share code, notes, and snippets.

View tejastank's full-sized avatar

Tejas Tank tejastank

  • India
View GitHub Profile
@tejastank
tejastank / proxy.php
Created June 9, 2017 03:44 — forked from codler/proxy.php
Simple PHP Proxy
<?php
/**
* @author Han Lin Yap < http://zencodez.net/ >
* @copyright 2012 zencodez.net
* @license http://creativecommons.org/licenses/by-sa/3.0/
* @package proxy
* @version 1.0 - 2012-05-01
*/
$method = $_SERVER['REQUEST_METHOD'];
$request = substr($_SERVER['PATH_INFO'], 1);
@tejastank
tejastank / gist:bbc00bb7363b03c8c83ab97a487f54cd
Created June 9, 2017 03:39 — forked from codler/gist:3906826
Support HTTP Header Range, mp4, php.php/mp4.mp4
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');
@tejastank
tejastank / gui_automation_python.md
Created May 1, 2017 04:10 — forked from diyan/gui_automation_python.md
Desktop GUI automation in Python

Desktop

UI Automation. Desktop. Python

GUI toolkit agnostic

autopy - simple, cross-platform GUI automation toolkit. MIT - https://github.com/msanders/autopy/

  • 432 stars, 102 forks, 2950 monthly downloads at 2015-05-13
  • GUI toolkit agnostic
from kivy.app import App
from kivy.uix.effectwidget import AdvancedEffectBase
from kivy.lang import Builder
from kivy.properties import NumericProperty
KV = '''
#:import Scanlines kivy.uix.effectwidget.ScanlinesEffect
#:import VerticalBlur kivy.uix.effectwidget.VerticalBlurEffect
#:import HorizontalBlur kivy.uix.effectwidget.HorizontalBlurEffect
#:import FXAA kivy.uix.effectwidget.FXAAEffect
class TouchRippleBehavior(object):
ripple_rad = NumericProperty(10)
ripple_pos = ListProperty([0, 0])
ripple_color = ListProperty((0., 0., 0., 1.))
ripple_duration_in = NumericProperty(.4)
ripple_duration_out = NumericProperty(.4)
fade_to_alpha = NumericProperty(.12)
ripple_scale = NumericProperty(4.0)
ripple_func_in = StringProperty('in_cubic')
ripple_func_out = StringProperty('out_quad')
@tejastank
tejastank / Github Webhook Tutorial.md
Created March 31, 2017 04:07 — forked from jagrosh/Github Webhook Tutorial.md
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@tejastank
tejastank / index.html
Created February 21, 2017 09:12 — forked from revskill10/index.html
D3.js drawing nodes and links from json structure
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>tags</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="d3.v2.min.js"></script>
@tejastank
tejastank / jinja2_file_less.py
Created November 9, 2016 06:37 — forked from wrunk/jinja2_file_less.py
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@tejastank
tejastank / sessiontest.py
Created November 8, 2016 19:01 — forked from alexcabrera/sessiontest.py
Example of using beaker sessions with bottle
import bottle
from beaker.middleware import SessionMiddleware
session_opts = {
'session.type': 'memory',
'session.cookie_expires': 300,
'session.auto': True
}
app = SessionMiddleware(bottle.app(), session_opts)
@tejastank
tejastank / phalconphp_php7_ubuntu_16_04.sh
Created September 19, 2016 15:54 — forked from Tosyn/phalconphp_php7_ubuntu_16_04.sh
PhalconPhp with PHP7 Installation on Ubuntu 16.04
#!/bin/bash
# PhalconPhp with PHP7 installation on ubuntu:16.04
sudo apt-get update
sudo apt-get install -y php7.0-fpm \
php7.0-cli \
php7.0-curl \
php7.0-gd \