Skip to content

Instantly share code, notes, and snippets.

View gpsarkar's full-sized avatar
💭
🚀

Ganapati Sarkar gpsarkar

💭
🚀
View GitHub Profile
@gpsarkar
gpsarkar / testcafe_read_file_and_assert_it_contains_text.js
Last active April 18, 2018 13:53
testcafe snippet for asserting a text contains in pptx file
import { Selector } from 'testcafe';
var textract = require('textract');
fixture `File read and assert`
.page(about:blank);
test('test file content', async t => {
const fullFilePath = 'c:\\temp\\test.pptx';
const stringToSearch = 'ABCDXYZ1234';
@gpsarkar
gpsarkar / tsung-commands.txt
Created April 25, 2018 05:58
Tsung Commands
Run Tsung
--------------------------------
tsung -f /root/tsung-scenarios/basic2.xml -l /root/tsung-scenarios/log/ start
tsung-recorder record_tag "<transaction name='groups'>"
plot
--------------------------------
/usr/lib/tsung/bin/tsung_stats.pl
/usr/local/lib/tsung/bin/tsung_stats.pl
@gpsarkar
gpsarkar / cleanup.bat
Created April 25, 2018 06:01
junk cleanup windows
cd C:\Users\%username%\AppData\Local
rmdir /S /Q Temp
del C:\Windows\Prefetch\*.* /Q
del C:\Windows\Temp\*.* /Q
del C:\Users\%username%\AppData\Local\VSEQT\QTAgent\*.* /Q
del C:\Users\%username%\AppData\Local\VSEQT\QTController\*.* /Q
@gpsarkar
gpsarkar / run-ie11-on-jenkins-local-acocunt-testcafe.txt
Last active April 30, 2018 13:44
Run IE11 on Jenkins as Local Account with testcafe
download PsExec from this URL : https://technet.microsoft.com/en-us/sysinternals/bb897553
execute this command : psexec -s -i “%programfiles%\Internet Explorer\iexplore.exe”
IE will open
make IE happy
close it
never touch it again
https://rostacik.net/2017/06/12/my-karma-tests-are-failing-in-ie-on-my-jenkins-and-i-dont-know-why/
@gpsarkar
gpsarkar / setup-git-repo-on-onedrive.txt
Last active June 13, 2024 01:52
Setup git repo on onedrive.
Go to onedrive folder in your pc and create a folder for git repository.
Usually onedrive resides in `C:\Users\%username%\OneDrive`
Open GitBash
cd ~/OneDrive
mkdir git
cd git
mkdir myproject
cd myproject
Note: The CSP report server should be on the same origin as the website, otherwise some browsers won't send the report. This can easily be achieved with a proxy. Here's an Nginx example:
location /csp-report {
rewrite ^(.*)$ / break; # Rewrite everything to just /
proxy_pass http://csp-report.herokuapp.com;
}
Ref: https://github.com/bu-ist/csp-report
@gpsarkar
gpsarkar / browser prefetch and performance.txt
Created June 17, 2018 20:16
browser prefetch and performance
Resolve DNS
<link rel="dns-prefetch" href="//example.com">
Resolve DNS and also make the TCP handshake and optional TLS negotiation
<link rel="preconnect" href="http://css-tricks.com">
Fetch and store in cache, Definitely for webfont
Linear gradient on line
<svg xmlns="http://www.w3.org/2000/svg" version="1"> <defs> <linearGradient id="e" x1="40" y1="235" x2="40" y2="265" gradientUnits="userSpaceOnUse"> <stop stop-color="steelblue" offset="0" /> <stop stop-color="red" offset="1" /> </linearGradient> </defs> <line x1="40" y1="210" x2="460" y2="290" stroke="url(#e)" stroke-width="30"/> </svg>
@gpsarkar
gpsarkar / JS-LINQ.js
Created July 22, 2018 14:23 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
@gpsarkar
gpsarkar / gist:19888bf7e042c707d25c64619829110e
Last active August 9, 2018 19:10
greasemonkey script for removing ads from a site
// ==UserScript==
// @name SanFoundaryRemoveAds
// @version 1
// @grant GM_util
// @match https://www.sanfoundry.com/*
// @author SRKR
// ==/UserScript==
// Styles function - needs to be added in GM 4