Skip to content

Instantly share code, notes, and snippets.

View gangadharjannu's full-sized avatar
🎯
Focusing

Gangadhar gangadharjannu

🎯
Focusing
  • Amsterdam
View GitHub Profile
@gangadharjannu
gangadharjannu / README.md
Created March 1, 2024 23:49 — forked from ppoffice/README.md
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
@gangadharjannu
gangadharjannu / example.js
Created September 26, 2023 20:37 — forked from amlwwalker/example.js
compiling and sending ehter to a payable function from nodejs
import ethers, {
Contract,
providers as Providers,
utils as Utils,
Wallet,
ContractFactory
} from "ethers"
import path from "path"
import fs from "fs"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
#visualizer {
background-color: #ddd;
}
@gangadharjannu
gangadharjannu / easing.js
Created October 18, 2018 14:52 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@gangadharjannu
gangadharjannu / post-merge
Last active June 5, 2018 11:04 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# COPY FROM THIS LINE, if your post-merge hook already contains content
# MIT © Sindre Sorhus - sindresorhus.com
# git `post-merge` hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
@gangadharjannu
gangadharjannu / e2e-shadowdom.md
Created June 4, 2018 10:52 — forked from ChadKillingsworth/e2e-shadowdom.md
Selenium Testing with Shadow DOM

End-to-end Testing with Shadow DOM

As the web component specs continue to be developed, there has been little information on how to test them. In particular the /deep/ combinator has been deprecated in Shadow DOM 1.0. This is particularly painful since most end-to-end testing frameworks rely on elements being discoverable by XPath or calls to querySelector. Elements in Shadow DOM are selectable by neither.

WebDriver.io

Webdriver.io has the standard actions by selectors, but also allows browser executable scripts to return an element

@gangadharjannu
gangadharjannu / infinite-scroll.directive.ts
Created June 6, 2017 11:52 — forked from lansana/infinite-scroll.directive.ts
This is an Angular 2 infinite scroll directive. It is simple, easy to use and very CPU-efficient.
// USAGE:
//
// When you attach the infiniteScroll directive to an element, it will emit the infiniteScrollAction
// @Output() event every time the user has scrolled to the bottom of the element. Your loadMoreArticles
// function can make an HTTP call and append the results to the articles list, for example. In doing this,
// you effectively increase the height of the element and thus begin the process of the infiniteScroll directive
// again, over and over until the element height stops increasing.
//
// <div class="container" infiniteScroll (infiniteScrollAction)="loadMoreArticles()">
// <div class="article" *ngFor="let article of articles">
@gangadharjannu
gangadharjannu / promises.md
Created April 22, 2017 22:15 — forked from domenic/promises.md
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.