Skip to content

Instantly share code, notes, and snippets.

View rahulmr's full-sized avatar
🏠
Working from home

Rahul Raut rahulmr

🏠
Working from home
View GitHub Profile
@rahulmr
rahulmr / angular.page.js
Last active November 30, 2016 10:46
Protractor example suite using page objects
'use strict';
var AngularPage = function () {
browser.get('http://www.angularjs.org');
};
AngularPage.prototype = Object.create({}, {
todoText: { get: function () { return element(by.model('todoList.todoText')); }},
addButton: { get: function () { return element(by.css('[value="add"]')); }},
yourName: { get: function () { return element(by.model('yourName')); }},
@rahulmr
rahulmr / .travis.linux.yml
Created March 21, 2017 11:20 — forked from chitoku-k/.travis.linux.yml
ChromeDriver on Travis CI
os: linux
node_js: '7'
sudo: required
env: DISPLAY=':99.0'
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
@rahulmr
rahulmr / Jenkinsfile
Created April 25, 2017 05:20 — forked from chinshr/Jenkinsfile
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@rahulmr
rahulmr / browse.tpl
Created May 1, 2017 21:01 — forked from peterhellberg/browse.tpl
Code7 template used by the Caddy browse directive
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<link rel="stylesheet" href="http://c7.se/css/main.css">
<style>
body { font-family: 'Helvetica Neue', Sans-serif; }
#list {
width: 100%;
}
@rahulmr
rahulmr / headless.md
Created June 1, 2017 13:41 — forked from addyosmani/headless.md
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@rahulmr
rahulmr / phantomjsGoogleSearch
Created July 20, 2017 16:11 — forked from ndhu/phantomjsGoogleSearch
phantomjs. example on how to search google, collect links of search result and scrape multiple pages of the search result
/**
* Created by andy hulstkamp
*/
var webpage = require("webpage"),
fs = require("fs");
var debug = false,
pageIndex = 0,
allLinks = [],
# install 7-zip, curl and vim
# (Windows 2012 comes with .NET 4.5 out-of-the-box)
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2012 64bits AMIs provided by Amazon (eu-west-1 ami-a1867dd6)
#
# Inject this as user-data of a Windows 2012 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# Set-ExecutionPolicy Unrestricted
@rahulmr
rahulmr / hello.ps1
Created July 29, 2018 12:13 — forked from lukesampson/hello.ps1
A simple example for Scoop documentation.
$name = split-path (whoami) -leaf
"Hello, $name!"
@rahulmr
rahulmr / user_authentication.py
Created May 26, 2020 23:56 — forked from jslvtr/user_authentication.py
Simple authentication with encryption using Flask and Python
"""
This file defines a User model and a Flask application, and implements authentication using encryption.
For more information, visit http://tecladocode.com/blog/learn-python-password-encryption-with-flask
"""
from flask import Flask, request, jsonify
from werkzeug.security import generate_password_hash, check_password_hash
import sqlite3
"""
Simple Moving Average implemented using KiteConnect Python library. -- [https://kite.trade](kite.trade)
Rainmatter (c) 2016
License
-------
This GIST is licensed under the MIT License
"""
from kiteconnect import KiteConnect