Skip to content

Instantly share code, notes, and snippets.

View gtechsltn's full-sized avatar
🍊

Nguyen Viet Manh gtechsltn

🍊
View GitHub Profile
@gtechsltn
gtechsltn / sha256.js
Created March 12, 2024 07:22 — forked from GaspardP/sha256.js
SHA-256 with Javascript and Web Crypto
// Computes the SHA-256 digest of a string with Web Crypto
// Source: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest
function sha256(str) {
// Get the string as arraybuffer.
var buffer = new TextEncoder("utf-8").encode(str)
return crypto.subtle.digest("SHA-256", buffer).then(function(hash) {
return hex(hash)
})
}
@gtechsltn
gtechsltn / pyclean.sh
Created January 29, 2024 04:34 — forked from technocake/pyclean.sh
Clear all python cache in directory
# pyclean command to clear all python cache in a directory
# source: https://stackoverflow.com/questions/28991015/python3-project-remove-pycache-folders-and-pyc-files
# in .bash_profile / .bash_rc etc put:
pyclean () {
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
}
@gtechsltn
gtechsltn / emberjs-cheat-sheet.md
Created January 24, 2024 02:17 — forked from ezy/emberjs-cheat-sheet.md
Ember.js Cheat Sheet

Core concepts

Model

  • An object that stores data (data persistance layer abstraction).
  • Templates transforms models into HTML.
  • Same thing as Rails model.

Template

@gtechsltn
gtechsltn / controllers.application.js
Created January 21, 2024 15:29 — forked from jelhan/controllers.application.js
ember-bootstrap-datepicker with momentjs
import Ember from 'ember';
const { computed } = Ember;
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
date: computed('model', {
get() {
return this.get('moment').toDate();
},
@gtechsltn
gtechsltn / README.md
Created January 21, 2024 14:58 — forked from Robert-96/README.md
Ember.Js: Installing Tailwind CSS

Ember.Js: Installing Tailwind CSS

TL;DR

$ ember install ember-cli-postcss                   # Install ember-cli-postcss
$ npm install --save-dev tailwindcss                # Install tailwindcss

$ npx tailwind init app/styles/tailwind.config.js   # Optional: Generate a Tailwind config file for your project  
$ npm install -save-dev postcss-import # Optional: If you want to use the @import statement
@gtechsltn
gtechsltn / debug_ember_app_in_vscode.md
Created January 21, 2024 09:04 — forked from nightire/debug_ember_app_in_vscode.md
How to debug an ember application with VS Code

Step 1: Launch Google Chrome with Remote Debugging support

  • windows: <path to chrome>/chrome.exe --remote-debugging-port=9222
  • macOS: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
  • linux: google-chrome --remote-debugging-port=9222

Step 2: Install "Debugger for Chrome" extension

Step 3: Setup your application

@gtechsltn
gtechsltn / index.html
Created January 20, 2024 15:07 — forked from Nikolas0606/index.html
Testing bootstrap and @media// Portfolio page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nicolas Marqui</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<script type="text/javascript " src="script/script.js"></script>
@gtechsltn
gtechsltn / ember_guides_combined
Created January 16, 2024 16:55 — forked from pinyin/ember_guides_combined
ember_guides_combined
# Guides and Tutorials
Welcome to the Ember.js guides! This documentation will take you from
total beginner to Ember expert. It is designed to start from the basics,
and slowly increase to more sophisticated concepts until you know
everything there is to know about building awesome web applications.
@gtechsltn
gtechsltn / AppCmdWrapper.ps1
Created January 12, 2024 04:50 — forked from adamcarr1976/AppCmdWrapper.ps1
A very basic powershell wrapper for appcmd.exe
$appCmdPath = "$env:SystemRoot\system32\inetsrv\appcmd.exe"
$webApplicationName = "Amc76.Web";
$iteration = "0.1"
$applicationPoolName = $webApplicationName + $iteration;
function Test-ApplicationPool([string]$appPoolName)
{
$appPool = . $appCmdPath list apppools $appPoolName
return $appPool -ne $null
}
@gtechsltn
gtechsltn / metatags.html
Last active January 11, 2024 07:12 — forked from MicBrain/metatags.html
The list of useful meta tags used in HTML5 documents.
<!DOCTYPE html>
<html lang="vi">
<head>
<!--Recommended Meta Tags-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="language" content="english">
<meta http-equiv="content-type" content="text/html">
<meta name="author" content="Global Technology Solution">
<meta name="designer" content="Global Technology Solution">