Skip to content

Instantly share code, notes, and snippets.

View hearsid's full-sized avatar
♠️
Focusing

Siddharth Sharma hearsid

♠️
Focusing
View GitHub Profile
@hearsid
hearsid / wave-height.json
Created August 26, 2023 06:48
Wave height sample data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Angular React
1. App bundle size 77.14KB 54.8KB
2. Heap size 8.6MB 8.7MB
3. DOM nodes 15,013 15,013
4. DCL- DOM Content Loaded 0.65s 0.14s
5. FCP- First Contentful Paint 0.87s 0.73s
6. LCP- Largest Contentful Paint 0.93s 0.78s
7. Time to Interactive
8. Scripting time 301ms 372ms
Angular React
1. App bundle size 77.14 KB 54.8 KB
2. Heap size 8.6 MB 8.7 MB
3. DOM nodes 15,013 15,013
4. DCL- DOM Content Loaded 650 ms 140 ms
5. FCP- First Contentful Paint 779 ms 606 ms
6. LCP- Largest Contentful Paint 811 ms 641 ms
7. Time to Interactive 950 ms 730 ms
8. Scripting time 301 ms 372 ms
@hearsid
hearsid / priority_queue.cs
Created February 11, 2019 09:07
Priority queue simple implementation in C#
public class PrioQueue<T>
{
int total_size;
SortedDictionary<int, Queue<T>> storage;
public PrioQueue()
{
this.storage = new SortedDictionary<int, Queue<T>>();
this.total_size = 0;
@hearsid
hearsid / gulpfile.js
Created February 28, 2016 16:45
File to watch and compile less files in (./css) folder and compile es6 file using babel in (./js/*/*-es6.js) folder with mentioned ending letters . On starting the script the files are compiled once . You can also individually compile just less or es6 files .
// Automate front end processes
// TODO
// 1) use npm plugin angular template cache to generate cache of either the html or the jsp files
var less = require('gulp-less');
var path = require('path');
var gulp = require('gulp');
var minifyCSS = require('gulp-minify-css');
var watch = require('gulp-watch');
var babel = require('gulp-babel');
@hearsid
hearsid / base64_convert_svgs.sh
Last active December 9, 2015 10:40
Get base64 format of a batch of svg files in a folder and get js / json file containing the same as key value pair .
#!/bin/sh
output_file=output.txt
# remove the file if it exists
if [ -f $output_file ] # spaces in square brackets required for proper syntax
then
rm -f $output_file
fi
for i in *.svg; do
@hearsid
hearsid / template_spec.js
Created October 21, 2015 09:36
Jasmine - Restler template for creating E2E test for restful api
var restler = require('restler');
var fs = require('fs');
var colors = require('colors');
var util = require('util');
var config = require('../config.js');
var baseUrl = config.baseUrl;
describe('lorum ipsum' , function() {
@hearsid
hearsid / deploy
Created September 21, 2015 09:00
Bash script to easily deploy the code from your local machine to bitbucket , and then login to the server and download the updated code from bitbucket to your server .
#!/bin/bash
git add --all
git commit -m "committing all changes"
git push origin master
ssh -t -t [email protected] << EOF
pwd
cd /var/www/html/my-app/
@hearsid
hearsid / phone_otp_verify_userRegister_spec.js
Last active September 15, 2015 10:40
Nodejs , restler and jasmine-node used for testing restful api testing , since Javascript runs asynchronously the code has been written to test API's whose output can treat as input of next api call . You can create a config.js file which contains values shared between various files . Install all the requirements and use jasmine-nod phone_otp_ve…
var restler = require('restler');
var fs = require('fs');
var colors = require('colors');
var util = require('util');
var config = require('./config.js');
var baseUrl = config.baseUrl;
describe("My project phone api's tests", function () {
var apiCall;
@hearsid
hearsid / DatabaseSeeder.php
Last active September 15, 2015 10:10
Laravel 5.1 : seed data from CSV files located in your {app}/database/seeds/CSV_FILES folder , first line of CSV must be table headings and consecutive lines the data to seed , no need to change the table structure in seeder , just change in CSV file .
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*