Skip to content

Instantly share code, notes, and snippets.

View imalhasaranga's full-sized avatar
🎯
Focusing

Imal Hasaranga Perera imalhasaranga

🎯
Focusing
View GitHub Profile
@imalhasaranga
imalhasaranga / gist:15e56e9263eeae4b858d3f818a72a3b9
Created September 17, 2019 19:16
Country code JSON with Alpha 2 codes
[{
"alpha_2": "AF",
"text": "Afghanistan"
}, {
"alpha_2": "AX",
"text": "Åland Islands"
}, {
"alpha_2": "AL",
"text": "Albania"
}, {
@imalhasaranga
imalhasaranga / gist:f039cb7f49ab7b5d93adf7b1558709ee
Created September 17, 2019 19:13
Country Dial codes and Country Alpha 2 codes JSON
[{
"dial_code": "213",
"text": "Algeria (+213)",
"alpha2": "DZ"
}, {
"dial_code": "376",
"text": "Andorra (+376)",
"alpha2": "AD"
}, {
"dial_code": "244",
@imalhasaranga
imalhasaranga / App.ts
Last active July 6, 2018 00:43
Setup Development Environment for Basic Typescript Project
//This is how your App.ts will look like
import "jquery-ui-dist/jquery-ui.min.js" // load your external js files
import "jquery-ui-css/jquery-ui.theme.css" // load your external css files
import { A } from "./services/A"; //sample code, import typescript classes
@imalhasaranga
imalhasaranga / uglify.js
Created May 7, 2018 08:17
Sample Uglify Result
function getUserName(userid){
return UserService.fetch(userid)
}
/* you should see similar script after doing uglify */
function a(i){
return u.f(i);
}
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
@imalhasaranga
imalhasaranga / .htacess
Created May 7, 2018 08:07
Cache Controll .htacess
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rdf+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/json "access plus 0 seconds"