Skip to content

Instantly share code, notes, and snippets.

View icemojo's full-sized avatar

Ye Mon Aung icemojo

View GitHub Profile
@icemojo
icemojo / git: gitignore.md
Created June 10, 2022 14:07 — forked from jstnlvns/git: gitignore.md
a gitignore cheatsheet

Git sees every file in your working copy as one of three things:

  1. tracked - a file which has been previously staged or committed;
  2. untracked - a file which has not been staged or committed; or
  3. ignored - a file which Git has been explicitly told to ignore.

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:

  • dependency caches, such as the contents of /node_modules or /packages
  • compiled code, such as .o, .pyc, and .class files
@icemojo
icemojo / UpstreamRepos.md
Created October 22, 2021 06:52 — forked from rowland007/UpstreamRepos.md
Describes how to add an upstream remote repo to your forked/cloned repo to get the latest updates.

Keep a Downstream git Repository Current with Upstream Repository Changes

A downstream repository (aka a “fork”) maintainer commonly needs to stay current with upstream work (aka "original"). The case is development continues on the upstream repo while you work on your own origin fork. You want to fetch the upstream changes and apply them to your origin so you don't make conflicts.

image cannot be displayed

The following steps allow you to achieve this on the command line in a local git repository.

Add the Remote Upstream Repository

@icemojo
icemojo / fork-own-repo.md
Created October 17, 2021 09:47 — forked from clintliang/fork-own-repo.md
How to Fork Your Own Project on Github

How to Fork Your Own Project on Github

Steps on how to create fork-repo from your own original-repo

On Github.com

  1. Create a new empty fork-repo repository on Github

On local

  1. Clone fork-repo
@icemojo
icemojo / quick-ref-jekyll-markdown.md
Created February 13, 2021 16:08 — forked from roachhd/quick-ref-jekyll-markdown.md
Jekyll Markdown Quick Reference

#Jekyll Markdown Quick Reference

####Write in simply awesome markdown

layout: post
title: Markdown Style Guide
---
@icemojo
icemojo / PromotionController.cs
Created May 14, 2019 05:03
A sample .NET MVC controller action code to asynchronously call a JSON API from the server side.
public class PromotionsController : Controller
{
/// GET /promotions/{id}
public ActionResult Details(int id)
{
string apiUrl = $"http://strapi.wph.sg:1388/promos/{id}";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add(name: "Accept", value: "application/json");
@icemojo
icemojo / sc-getitem.cs
Created March 21, 2019 10:47
Sitecore - Get an item directly by it's ID, from the "master" database.
Sitecore.Data.Database masterDb = Sitecore.Configuration.Factory.GetDatabase("master");
Sitecore.Data.Items.Item item = masterDb.GetItem(new Sitecore.Data.ID(Constants.HomeItemId));
@icemojo
icemojo / init-simple-unity.js
Created March 21, 2019 00:06
A simple NodeJS script to create the most simplistic Unity project folder structure. The script has to reside in a sub-folder under the main Unity project directory (e.g., Utils).
var fs = require('fs');
var path = require('path');
var assetsFolder = '../Assets';
var simpleFolders = ['Scripts', 'Sprites', 'Prefabs', 'Scenes', 'Animations', 'Sounds'];
simpleFolders.forEach(function(item) {
console.log('Creating folder ' + item + '...');
fs.mkdir(path.join(assetsFolder, item), function(err) {
if (err && err.code === 'EEXIST') {
@icemojo
icemojo / unity.gitignore
Last active March 19, 2019 08:59
.gitignore file for a standard Unity project.
# Standard game dev stuffs
[Bb]uilds/*
# Unity folders
[Ll]ibrary/
[Oo]bj/
[Tt]emp/
[Ll]ogs/
# Rider
@icemojo
icemojo / manifest.json
Last active March 19, 2019 08:56
Unity manifest.json entries for minimal 2D game. Versions of the third party packages can easily become outdated.
{
"dependencies": {
"com.unity.package-manager-ui": "2.0.3",
"com.unity.textmeshpro": "1.3.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
@icemojo
icemojo / app.js
Created March 19, 2019 08:42
A simple NodeJS HTTP server to respond contents from data.json in the same directory. Change the 'type' variable to switch between different files.
const http = require('http');
const fs = require('fs');
const hostname = 'localhost';
const port = 8080;
const type = 'json' || 'xml';
var server = http.createServer((req, resp) => {
resp.statusCode = 200;
resp.setHeader('Content-Type', `application/${type}`);