Skip to content

Instantly share code, notes, and snippets.

View sarvsav's full-sized avatar
🌲
golang - green developer

Sarvsav Sharma (Max) sarvsav

🌲
golang - green developer
View GitHub Profile
@sarvsav
sarvsav / embed-gist-in-blogger.js
Created January 23, 2022 08:38 — forked from hanxue/embed-gist-in-blogger.js
Embed Gists in Blogger
At the end of your Blogger post , using HTML editor, append this
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>
In the content of your blog post, simply add this:
<div class="gistLoad" data-id="8488564" id="gist-8488564">Loading https://gist.github.com/8488564....</div>
Note: adding the URL is useful because when the javascript does not work, readers can copy and paste the URL themselves.
@sarvsav
sarvsav / PHP Project
Created September 25, 2015 18:50
PHP project directory structure, recommend by zend
<project_name>/
application/
configs/
application.ini
controllers/
helpers/
forms/
layouts/
filters/
helpers/
@sarvsav
sarvsav / Bash project
Created September 25, 2015 18:48
Bash project directory structure
β”œβ”€β”€ bin => Contains binary of your project
β”œβ”€β”€ docs => Contains documentation and future aspects about your project
β”‚ └── ToDo => ToDo List of your project
β”œβ”€β”€ etc => Add configuration files under this directory
β”‚ └── imdb-xplorer.cfg => Configuration file
β”œβ”€β”€ LICENSE => Add license for your project
β”œβ”€β”€ logs => This directory contains logs about behaviour of your script
β”‚ └── imdb-xplorer.log => log file
β”œβ”€β”€ README.md => Contains how to install, and use your project
β”œβ”€β”€ setup.sh => install the project on your machine
@sarvsav
sarvsav / Game Projects
Created September 25, 2015 18:47
For C++ game projects
|── autogen.sh
β”œβ”€β”€ CODING_STANDARDS.md
β”œβ”€β”€ configure
β”œβ”€β”€ data
β”‚ β”œβ”€β”€ characters.json
β”‚ β”œβ”€β”€ font
β”‚ β”‚ β”œβ”€β”€ font.ttf
β”‚ β”œβ”€β”€ images
β”‚ β”‚ β”œβ”€β”€ animation
β”‚ β”‚ β”‚ └── running
@sarvsav
sarvsav / Simple_Projects
Created September 25, 2015 18:43
Project Directory Structure for simple C++ applications
./ Makefile and configure scripts.
./src General sources
./include Header files that expose the public interface and are to be installed
./lib Library build directory
./bin Tools build directory
./tools Tools sources
./test Test suites that should be run during a `make test`
require_relative "rules"
# An object which represents the checkout process or cash register.
# It scans items, which are added to an internal list of items,
# which are then used to return the #total at any given moment.
# This total tries to use the rules which lead to the cheapest price.
class CheckOut < Struct.new(:rules)
attr_accessor :rules # list of available pricing rules (passed on initialization)
attr_accessor :items # hash of scanned items and quantities
# { "A" => 0, "B" => 1 } means we have scanned one "A" and zero "B"s
@sarvsav
sarvsav / git_intro.txt
Last active December 24, 2015 06:49
My First attempt
Introduction to git
What is git?
- git is basically, a version control system where you can collaborate with
other and work on your projects. Developed by Linus.
Advantages of using git over other version system?
- git maintains snapshot of your projects, while other SVN store the diff for every change.
- git uses SHA1, so data loss is almost impossible (checks for data integrity).
- git maintains the local database, so the search is faster as compare to other.