Skip to content

Instantly share code, notes, and snippets.

View ngnam's full-sized avatar

Nguyen Van Nam ngnam

View GitHub Profile
@ngnam
ngnam / IIS Rewrite Cheat Sheet
Created September 18, 2023 08:22 — forked from developerdizzle/IIS Rewrite Cheat Sheet
IIS Rewrite Cheat Sheet
<rewrite>
<!-- Have a bunch of redirects? Put them in a separate file -->
<rules configSource="Rewrites.config" />
<rules>
<!-- Simple rewrite -->
<rule name="Simple rewrite" stopProcessing="true">
<match url="^path/sub path/page\.aspx$" />
<action type="Rewrite" url="/newpath.aspx" />
@ngnam
ngnam / IIS Rewrite Cheat Sheet
Created September 18, 2023 08:22 — forked from developerdizzle/IIS Rewrite Cheat Sheet
IIS Rewrite Cheat Sheet
<rewrite>
<!-- Have a bunch of redirects? Put them in a separate file -->
<rules configSource="Rewrites.config" />
<rules>
<!-- Simple rewrite -->
<rule name="Simple rewrite" stopProcessing="true">
<match url="^path/sub path/page\.aspx$" />
<action type="Rewrite" url="/newpath.aspx" />
@ngnam
ngnam / Countdown.js
Created June 14, 2023 10:07 — forked from chriskonnertz/Countdown.js
Simple JavaScript Countdown Snippet
<div class="countdown" data-datetime="<?php echo time() ?>">
<span class="days">0</span> days
<span class="hours">0</span> hours
<span class="minutes">0</span> minutes
<span class="seconds">0</span> seconds
</div>
<script>
(function()
{
@ngnam
ngnam / Category.sql
Created December 19, 2022 04:37 — forked from ticean/Category.sql
A series of queries for selecting Magento entity EAV attributes, and their values. Lots of union here...
SET @entityid = '3';
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav
ON e.entity_id = eav.entity_id
JOIN eav_attribute ea
ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
UNION
@ngnam
ngnam / rest-api-cheatsheet.md
Created November 27, 2021 17:25 — forked from jahe/rest-api-cheatsheet.md
REST API Cheatsheet

REST API Cheatsheet

Source: https://www.youtube.com/watch?v=5WXYw4J4QOU

  • POST, GET, PUT, DELETE != CRUD
  • no verbs -> just nouns for Resources: /applications or /applications/123
  • Possible Responses: Collection of Resources (e.g. with Links) or One instance of a Resource
  • Keep your API course grained to be scaleble to future requirements
  • For Resources: Be as specific as possible: /customers vs. /newsletter-customers and /registered-customers
  • PUT for Create: Can be used when the Client has the ability to create an identifier for the Resource himself. But it has to contain a full replacement of the dataset: PUT /applications/123
@ngnam
ngnam / gh-pages-deploy.md
Created September 16, 2020 14:20 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@ngnam
ngnam / angular-cli-node-js-typescript-support.csv
Last active March 28, 2022 17:28 — forked from LayZeeDK/angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Angular CLI, Angular, Node.js and TypeScript compatibility.
Angular CLI version Angular version Node.js version TypeScript version
- 2.x 6.0.x or later minor version 2.0.x
1.0.6 4.x 6.9.x or later minor version 2.2.x
1.1.3 4.x 6.9.x or later minor version 2.3.x
1.2.7 4.x 6.9.x or later minor version 2.3.x
1.3.2 4.2.x or later minor version 6.9.x or later minor version 2.4.x
1.4.10 4.2.x or later minor version 6.9.x/8.9.x or later minor version 2.4.x
(1.5.6) 5.0.x 6.9.x/8.9.x or later minor version 2.4.x
1.5.6 5.1.x 6.9.x/8.9.x or later minor version 2.5.x
1.6.7 5.2.x or later minor version 6.9.x/8.9.x or later minor version 2.5.x
@ngnam
ngnam / meta-tags.md
Created July 21, 2020 10:07 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
Name: Flash
Serial: eNrzzU/OLi0odswsqnHLSSzOqDGoca7JKCkpsNLXLy8v1ytJTczVLUotKNFLzs8FAJHYETc=
if anyone wants to thank ETH: 0x527c2aB55b744D6167dc981576318af96ed26676
Thank you!