Skip to content

Instantly share code, notes, and snippets.

View arttuladhar's full-sized avatar

Aayush Tuladhar arttuladhar

View GitHub Profile

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@arttuladhar
arttuladhar / kafka.md
Last active August 12, 2021 21:12 — forked from ashrithr/kafka.md
## Getting Started with Kafka

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@arttuladhar
arttuladhar / snprint.c
Created July 20, 2015 05:10
snprintf_demo
#include <slack/std.h>
#ifndef HAVE_SNPRINTF
#include <slack/snprintf.h>
#endif
int main(int ac, char **av)
{
char buf[16];
char *str = buf;
char *extra = NULL;
@arttuladhar
arttuladhar / distccmonitor.sh
Created July 20, 2015 15:51
Distcc HealthMonitor
#!/bin/bash
# Aayush Tuladhar
# v1.0 (2011)
# DistCC Monitor
# Performs Distcc On the Host Servers. Gets the compilation time and delivers email using sendmail.
HOSTFILE=/usr/local/itasca/buildtools/etc/lsdistcc_hosts
sendmailbin=/usr/sbin/sendmail
WORKING_DIR=`pwd`
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.Writer;
public class PlayingWithStrings {
/**
* @param args
*/
@arttuladhar
arttuladhar / softwareengineeringexcel.md
Created July 31, 2015 04:06
Software Engineering Competency Checklist

Software Engineering Excellency

DATA STRUCTURES
  • Doesn’t know the difference between Array and LinkedList
  • Able to explain and use Arrays, LinkedLists, Dictionaries etc in practical programming tasks
  • Knows space and time tradeoffs of the basic data structures, Arrays vs LinkedLists, Able to explain how hashtables can be implemented and can handle collisions, Priority queues and ways to implement them etc.
  • Knowledge of advanced data structures like B-trees, binomial and fibonacci heaps, AVL/Red Black trees, Splay Trees, Skip Lists, tries etc
ALGORITHMS
  • Unable to find the average of numbers in an array
Mac Shortcut Windows Shortcut Description
⌘ + ⇧ + R Ctrl + Shift + R Open / Search for Resources
⌘ + ⇧ + T Ctrl + Shift + T Open / Search for types (Useful in finding classes)
⌘ + O Ctrl + O Shows Quick Outline of the Java Class
⌘ + T CTRL-T Show type hierarchy
ALT – ↑ or ↓ ALT – ↑ or ↓ Move line/block
⌃ + Space Ctrl + Space Content assist and Code completion
⌘ + ⇧ + F Ctrl + Shift + F Format source code
⌘ + L Ctrl + L Go to Line Number
@arttuladhar
arttuladhar / cookieSession.java
Created July 31, 2015 05:07
Java cookie session
String user_id = null;
String username = null;
//Check Cookie for the saved session
Cookie[] cookies = request.getCookies();
String _cookieName_id = "user_id";
String _cookieName_user = "user_name";
String _cookie_userid_Value = null;
String _cookie_usernameValue = null;
@arttuladhar
arttuladhar / automove.sh
Created August 5, 2015 20:22
Scheduled Auto File Move/Copy Script
#Scheduled Auto File Move/Copy Script
#------------------------------------
# #Filename : config
# #Config File for File Dropper
# AUTHOR=Aayush Tuladhar
# DESTINATION_DIR=/appserver/userDocs
# 5 -- 5 Sec
# 300 - 5 Minutes
# 900 -- 15 Minutes
@arttuladhar
arttuladhar / Kitchen-CheetSheet.md
Last active May 26, 2023 16:19
Chef and Knife Commands CheatSheet

Kitchen Commands

kitchen list
kitchen create
kitchen destroy
kitchen login <InstanceName>