Skip to content

Instantly share code, notes, and snippets.

View sidthesloth92's full-sized avatar

Dinesh Balaji sidthesloth92

View GitHub Profile
@sidthesloth92
sidthesloth92 / Particle.js
Last active December 23, 2020 14:30
A light weight implementation of particles for Canvas. To be used in conjunction with Vector.js
class Particle {
constructor({ radius, position, velocity = new Vector(0, 0), gravity = 0, mass = 1, friction = 0.99, update = true }) {
this.radius = radius;
this.position = position;
this.velocity = velocity;
this.mass = mass;
this.gravity = new Vector(0, gravity);
this.friction = friction;
this.update = update;
}
@sidthesloth92
sidthesloth92 / Vector.js
Last active December 23, 2020 14:28
A simple lightweight math vector implementation.
/**
* Represents a math vector with x, y position, direction and magnitude.
*/
class Vector {
constructor(x, y) {
this._compute(x, y);
}
_compute(x, y) {
this.x = x;
this.y = y;
@sidthesloth92
sidthesloth92 / Readme.md
Last active June 26, 2020 05:18
Gives a table view of the hours logged in JIRA for a user for a given time period.

Description

Gives a table view of the hours logged in JIRA for a user for a given time period.

Instructions

  • Go to this URL: https://bookmarkify.it/36312
  • Drag and drop the bookmarklet to the bookmarks bar.
  • Navigate to https://.atlassian.net and click on the bookmarklet and see the ✨
@sidthesloth92
sidthesloth92 / README.md
Last active November 22, 2018 11:17
NVE - Three Finger Tap JS

Instructions

  • Right Click on the Bookmarks bar
  • Click on Add Page
  • Copy the contents of script.js and paste it as the value of URL text box. Hit Save.
  • Navigate to JIRA issues filter page and click on the saved bookmark once. You will get an alert. Hover over any issue number or title in and Enjoy the awesomeness.. 🎊
import {Component} from 'angular2/core';
import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {ViewOneComponent} from "./viewone.component";
import {ViewTwoComponent} from "./viewtwo.component";
import {ChildStatesRootComponent} from "./child-states/child-states-root.component";
@Component({
selector : 'my-app',
template : `<nav>
import {Component} from 'angular2/core';
@Component({
selector: 'child-state-two',
template : `This is child state two`
})
export class ChildStateTwoComponent {}
import {Component} from 'angular2/core';
@Component({
selector: 'child-state-one',
template : `This is child state one`
})
export class ChildStateOneComponent {}
import {Component} from 'angular2/core';
import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {ChildStateOneComponent} from "./child-state-one.component";
import {ChildStateTwoComponent} from "./child-state-two.component";
@Component({
selector: 'child-state-root',
template : `This is the child state root page
<nav>
<a [routerLink]="['ChildStateOne']">Child State One</a>
import {Component, OnInit} from 'angular2/core';
import {RouteParams, RouteData} from 'angular2/router';
@Component({
selector : 'view-two',
template: `These are the values returned from view one: <br />
Route Parameter : {{ routeParameter }} <br />
Query Parameter : {{ queryParameter }} <br />
Route Data : {{ routeData }} <br />
<button (click)="goBack()">Go Back</button>`
import {Component} from 'angular2/core';
import {Router} from 'angular2/router';
@Component({
selector : 'view-one',
template : `Route Parameter: <input type="text" [(ngModel)]="routeParameter"/> <br />
Query Parameter: <input type="text" [(ngModel)]="queryParameter"/> <br />
<button type="button" (click)="sendData()">Send</button>`
})