Skip to content

Instantly share code, notes, and snippets.

View sagarkarira's full-sized avatar
:octocat:
1x dev

Sagar Karira sagarkarira

:octocat:
1x dev
View GitHub Profile
@sagarkarira
sagarkarira / index.html
Created February 7, 2025 19:39
Rose 3D
<!--
Rose 3D
- three.js OBJLoader demo
Rose 3D Model : archive3d https://archive3d.net/?a=download&id=5daf66f8# : cc0
- [model changeLog] Remove stems and materials
-->
<!-- using three.js -->
<main>
@sagarkarira
sagarkarira / git-cli.js
Created July 9, 2019 08:16
[Git commands] Some not so common but useful commands I need to remember #git #cli
## Git diff excluding certain files
``
git diff -- . ':(exclude)package-lock.json'
``
##
@sagarkarira
sagarkarira / es-mapping-update.md
Last active May 29, 2019 10:59
Add a new field to the existing mapping in ES
@sagarkarira
sagarkarira / bq-cli.md
Last active May 29, 2019 09:33
google bigquery commands most used by me.

####Listing all tables in a dataset

bq ls -n 9000 project:dataset

Deleting a table in dataset

@sagarkarira
sagarkarira / The Technical Interview Cheat Sheet.md
Created September 28, 2016 18:02 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@sagarkarira
sagarkarira / logstash.md
Last active September 21, 2016 12:35
Elastic Search, Logstash, Kibana and Filebeats (ELK Stack )

Adding alias of logstash to the .bashrc

alias logstash='bash /opt/logstash/bin/logstash'

Basic logstash pipeline will output what is inputted to the command line

logstash -e 'input { stdin { } } output { stdout {} }'

Testing config files

  • logstash --configtest -f first-pipeline.conf
  • sudo service logstash configtest
@sagarkarira
sagarkarira / master-slave-sql.md
Last active September 21, 2016 10:54
Noted command during master slave sql replication

Changing MySql Password -

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

Taking mysql dump along with master server pos and file without locking write commands -

mysqldump -u root -p --single-transaction --master-data=2 freshman &gt; freshman.sql

It's important to note that setTimeout(..) doesn't put your callback on the event loop queue. What it does is set up a timer; when the timer expires, the environment places your callback into the event loop, such that some future tick will pick it up and execute it.
What if there are already 20 items in the event loop at that moment? Your callback waits. It gets in line behind the others -- there's not normally a path for preempting the queue and skipping ahead in line. This explains why setTimeout(..) timers may not fire with perfect temporal accuracy. You're guaranteed (roughly speaking) that your callback won't fire before the time interval you specify, but it can happen at or after that time, depending on the state of the event queue.
@sagarkarira
sagarkarira / understanding-typeof.js
Last active August 27, 2016 11:02
Fundamentals on typeof and data types in JS
/** So this one is simple. Object are object */
var obj = {};
console.log(obj); //{}
console.log(typeof(obj)); //object
/** Doubt-1 Why does JS returns typeof of function as function.
All functions are objects in JS. Look ahead.
Doubt -2 Why it doesn't print {[Function]} ?
Doubt -3 Are not object have key value pair ? value of function object is [Function] but what is the key ?
SELECT
tb_sub_items.sub_item_id ,
tb_sub_items.sub_item_name,
(tb_pricing.price/ tb_base_unit.conversation_factor) as purchase_price_input
FROM
tb_sub_items
JOIN
tb_pricing
ON tb_pricing.sub_item_id = tb_sub_items.sub_item_id
JOIN