Skip to content

Instantly share code, notes, and snippets.

View sr6033's full-sized avatar
๐Ÿ‹๏ธโ€โ™‚๏ธ
Building softwares that matter

Shubham Rath sr6033

๐Ÿ‹๏ธโ€โ™‚๏ธ
Building softwares that matter
View GitHub Profile
@sr6033
sr6033 / bfs_stl.cpp
Last active August 11, 2018 17:57
Breadth First Search using C++ STL
#include <bits/stdc++.h>
using namespace std;
vector <vector <int>> g; // Graph vector
vector <bool> v; // Visited nodes
// Directed Graph
void addEdge(int a, int b)
{
g[a].push_back(b);
@sr6033
sr6033 / heapSort.cpp
Last active August 11, 2018 17:57
Heap Sort using C++ STL
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> arr(n);
// Generating random numbers in a range of 0-100
@nabrown
nabrown / grams-final.html
Last active June 21, 2020 22:46
Instagram Gallery - Complete
<!DOCTYPE html>
<html>
<head>
<title>Instagram Gallery</title>
<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<style type="text/css">
:root{
--color: #95e9ef;
--background: #1f1f1f;
@psengh
psengh / osx-setup.sh
Last active June 12, 2020 07:45
Script to setup new OSX Machine
#!/usr/bin/env bash
echo "Enter you Name : (Optional, to configure Git)"
read NAME
echo "Enter your Email : (Optional, to configure Git)"
read EMAIL
echo "Give a name to your Computer : (Optional, to set Host Name)"
read HOSTNAME
@joepie91
joepie91 / .md
Last active March 7, 2025 22:07
Prefix codes (explained simply)

A "prefix code" is a type of encoding mechanism ("code"). For something to be a prefix code, the entire set of possible encoded values ("codewords") must not contain any values that start with any other value in the set.

For example: [3, 11, 22] is a prefix code, because none of the values start with ("have a prefix of") any of the other values. However, [1, 12, 33] is not a prefix code, because one of the values (12) starts with another of the values (1).

Prefix codes are useful because, if you have a complete and accurate sequence of values, you can pick out each value without needing to know where one value starts and ends.

For example, let's say we have the following codewords: [1, 2, 33, 34, 50, 61]. And let's say that the sequence of numbers we've received looks like this:

1611333425012

@renshuki
renshuki / ubuntu_agnoster_install.md
Last active September 27, 2025 02:50
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@staltz
staltz / introrx.md
Last active December 1, 2025 11:31
The introduction to Reactive Programming you've been missing
@magnetikonline
magnetikonline / README.md
Last active December 22, 2021 17:13
Using Dnsmasq with Ubuntu 16.04LTS/14.04LTS/12.04LTS for virtual machine web application testing.

Using Dnsmasq with Ubuntu for VM web application testing

When running virtual machines under a Linux host system for testing web apps in various browsers (e.g. Internet Explorer), I found it rather tedious having to continually tweak the hosts file within each VM for the purpose of adding entries pointing back to the host machine's development web server address.

Instead the steps below will setup Dnsmasq on a Ubuntu 16.04LTS, 14.04LTS or 12.04LTS host machine for the purpose of serving both it's own DNS queries and that of virtual machine guests. Dnsmasq will parse the /etc/hosts file on your host machine where we will keep a single set of DNS entires to our test web application(s).

@navinpai
navinpai / README
Created June 9, 2012 19:18
Simple CSS Blinking Cursor
Simple blinking cursor... code from http://xip.io/ ... Ofcourse I don't own the code! Just keeping it here as a reference of the CSS3 code used.
@JasonGiedymin
JasonGiedymin / rabbitmq.rake
Created November 19, 2011 21:34
Easy RabbitMQ Start/Stop Rake tasks for OSX
#
# Don't want to run PostgreSQL as a service? Want to manually start and stop it?
# >> bundle exec rake rabbitmq:mac:start
# >> bundle exec rake rabbitmq:mac:stop
#
namespace :rabbitmq do
namespace :mac do
desc "Starts a Mac brew installed RabbitMQ server."